fire-decode: moving Fire, 3D Review and Bite to use a shared image decoder

game-devtooling

fire-decode is the image decoder shared by Fire, 3D Review and Bite: one Rust crate that reads various image formats really fast.

Why make this?

I maintain three tools to help game dev workflows that all need a way to read images of various formats. They all have some common needs and goals:

I’ve spent a lot of time testing and benchmarking different image decoding libraries to find out the fastest way to read an image file, and I want all three applications to benefit when I update something. Beyond their main purpose, 3D Review and Fire also act as asset check tools and thumbnail providers for the operating system, and all of them need reading images for something.

Maintaining the same work across multiple projects quickly became a hassle, and I started to look for a shared library that would do the work needed for this.

Does something already exist for this?

Before writing fire-decode I spent some time looking for a publicly available equivalent. I found some, but none of them fit my needs.

Library PSD DDS EXR Why not
image 0.25.10 (+ image-extras) No Decode only Yes fire-decode already builds on it for PNG / HDR / TGA / TIFF / GIF. No PSD, and the slow paths above are in it
zune-image Base layer, 8/16-bit, grey/RGB/RGBA only (zune-psd, last release 2024) No No fire-decode already uses its JPEG / BMP / PPM / farbfeld decoders. No DDS / EXR / TGA
OpenImageIO Yes (RGB, CMYK, grey, indexed, multichannel) BC1-BC7, cube / volume / mips Yes Closest in coverage, but a heavy native dependency stack built for pipelines, not time-to-first-pixel; the only Rust binding found is a small third-party project (openimageio-rs)
SAIL Composite only No Simplified RGBA API No DDS, no Rust binding
libvips (Rust libvips 2.3.0) Via its ImageMagick loader No Yes Native LGPL stack, PSD only through ImageMagick, no DDS; for JPEG it would match, not beat, what bite already gets from jpeg:size
image_dds 0.6.1 - BC1-BC7 incl. BC6H - DDS only, and hides the format table fire-decode wants to own (already rejected in fire’s Cargo.toml)
oculante Via psd DXT1-5 Yes An application; its loading is not published as a reusable crate
libheif-sys 5.3.1 / libheif-rs - - - Codecs are not bundled, so libde265 and an AV1 decoder must still be supplied. It would replace only the part heif-sys already does with a small wrapper, and it has no gain-map handling

The current state of things

fire-decode now exists as a public git repo that Fire, 3D Review and Bite call fom this repository at a release tag.