Expand description
Encoding and decoding for various image file formats.
§Supported formats
| Format | Decoding | Encoding |
|---|---|---|
| AVIF | Yes (8-bit only) * | Yes (lossy only) |
| BMP | Yes | Yes |
| DDS | Yes | — |
| Farbfeld | Yes | Yes |
| GIF | Yes | Yes |
| HDR | Yes | Yes |
| ICO | Yes | Yes |
| JPEG | Yes | Yes |
| EXR | Yes | Yes |
| PNG | Yes | Yes |
| PNM | Yes | Yes |
| QOI | Yes | Yes |
| TGA | Yes | Yes |
| TIFF | Yes | Yes |
| WebP | Yes | Yes (lossless only) |
- * Requires the
avif-nativefeature, uses the libdav1d C library.
§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:
- A standard specifies that configuration x is required for decoders/encoders and there exists an essentially canonical way to control it.
- At least two different implementations agree on some (sub-)set of features in practice.
- 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.
Modules§
- avif
aviforavif-nativeEncoding of AVIF images. - bmp
bmpDecoding and Encoding of BMP Images - dds
ddsDecoding of DDS images - farbfeld
ffDecoding of farbfeld images - gif
gifDecoding of GIF Images - hdr
hdrDecoding of Radiance HDR Images - ico
icoDecoding and Encoding of ICO files - jpeg
jpegDecoding and Encoding of JPEG Images - openexr
exrDecoding of OpenEXR (.exr) Images - png
pngDecoding and Encoding of PNG Images - pnm
pnmDecoding of netpbm image formats (pbm, pgm, ppm and pam). - qoi
qoiDecoding and encoding of QOI images - tga
tgaDecoding of TGA Images - tiff
tiffDecoding and Encoding of TIFF Images - webp
webpDecoding and Encoding of WebP Images