Image transformation, compression, and decompression codecs
Imagecodecs is a Python library that provides block-oriented, in-memory buffer transformation, compression, and decompression functions for use in tifffile, liffile, czifile, zarr, and other scientific image input/output packages.
Decode and/or encode functions are implemented for the following codecs, image formats, and data transforms: Zlib (DEFLATE), GZIP, LZMA, ZStandard (ZSTD), Blosc, Brotli, Snappy, BZ2, LZ4, LZ4F, LZ4HC, LZ4H5, LZW, LZO, LZF, LZFSE, LZHAM, PGLZ (PostgreSQL LZ), RCOMP (Rice), HCOMP, PLIO, ZFP, SZ3, Meshopt, Pcodec, SPERR, AEC, SZIP, LERC, EER, NPY, BCn, DDS, BMP, PNG, APNG, GIF, PCX/DCX, TGA (TARGA), TIFF, WebP, JPEG (2 to 16-bit), Lossless JPEG (LJPEG, LJ92, JPEGLL), JPEG 2000 (JP2, J2K), High-throughput JPEG 2000 (HTJ2K, JPH), JPEG LS, JPEG XL, JPEG XS, JPEG XR (WDP, HD Photo), Ultra HDR (JPEG_R), MOZJPEG, AVIF, HEIF, EXR, WIC (Windows Imaging Component), WavPack, QOI, RGBE (HDR), PixarLog, Jetraw, DICOM RLE, CCITT (RLE, T.4 and T.6), PackBits, Packed Integers (TIFF, MONO p and packed), Delta, XOR Delta, Floating Point Predictor, Bitorder reversal, Byteshuffle, Bitshuffle, Float24 (24-bit floating point), Bfloat16 (brain floating point), Quantize (Scale, BitGroom, BitRound, GranularBR), and CMS (color space transformations). Checksum functions are implemented for CRC-32, Adler-32, Fletcher-32, and Jenkins lookup3.
Changes
- Add Zarr 3 compatible codecs.
- Add WIC codec based on Windows Imaging Component.
- Add EXR codec based on OpenEXRCore library.
- Add WAVPACK codec based on WavPack library.
- Add HCOMP and PLIO codecs based on modified cfitsio library.
- Add TGA and PCX/DCX legacy codecs.
- Add option to pass SDR image to ultrahdr_encode.
- Add option to specify primaries and transferfunction in jpegxl_encode (#137).
- Add animated WebP encoding and decoding of all frames (breaking).
- Remove cms_encode and cms_decode aliases for cms_transform (breaking).
- Determine colorspace/pixeltype from profiles in cms_transform.
- Allow to pass IntEnum parameters as strings except for levels.
- Support decoding RLE8 and RLE4 compressed BMP.
- Link zopfli_encode level to numiterations parameter.
- Unify image layout handling in encode functions.
- Fix code review issues.
- Drop support for numpy 2.0 (SPEC0), Python 3.11, and macosx_x86_64.