Expand description

Encoding and decoding for various image file formats.

Supported formats

PNGAll supported color typesSame as decoding
JPEGBaseline and progressiveBaseline JPEG
BMPYesRgb8, Rgba8, Gray8, GrayA8
TIFFBaseline(no fax support) + LZW + PackBitsRgb8, Rgba8, Gray8
WebPYesRgb8, Rgba8
AVIFOnly 8-bitLossy
PNMPBM, PGM, PPM, standard PAMYes
TGAYesRgb8, Rgba8, Bgr8, Bgra8, Gray8, GrayA8
OpenEXRRgb32F, Rgba32F (no dwa compression)Rgb32F, Rgba32F (no dwa compression)

A note on format specific features

One of the main goals of image is stability, in runtime but also for programmers. This ensures that performance as well as safety fixes reach a majority of its user base with little effort. Re-exporting all details of its dependencies would run counter to this goal as it linked all major version bumps between them and image. As such, we are wary of exposing too many details, or configuration options, that are not shared between different image formats.

Nevertheless, the advantage of precise control is hard to ignore. We will thus consider wrappers, not direct re-exports, in either of the following cases:

  1. A standard specifies that configuration x is required for decoders/encoders and there exists an essentially canonical way to control it.
  2. At least two different implementations agree on some (sub-)set of features in practice.
  3. A technical argument including measurements of the performance, space benefits, or otherwise objectively quantified benefits can be made, and the added interface is unlikely to require breaking changes.

Features that fulfill two or more criteria are preferred.

Re-exports of dependencies that reach version 1 will be discussed when it happens.


Decoding and Encoding of BMP Images
Decoding of DDS images
Decoding of DXT (S3TC) compression
Decoding of farbfeld images
Decoding of GIF Images
Decoding of Radiance HDR Images
Decoding and Encoding of ICO files
Decoding and Encoding of JPEG Images
Decoding of OpenEXR (.exr) Images
Decoding and Encoding of PNG Images
Decoding of netpbm image formats (pbm, pgm, ppm and pam).
Decoding of TGA Images
Decoding and Encoding of TIFF Images
Decoding and Encoding of WebP Images