Skip to main content

Image transformation, compression, and decompression codecs

Project description

Imagecodecs is a Python library that provides block-oriented, in-memory buffer transformation, compression, and decompression functions for use in the tifffile, czifile, and other scientific imaging modules.

Decode and/or encode functions are implemented for Zlib (DEFLATE), ZStandard (ZSTD), Blosc, Brotli, Snappy, LZMA, BZ2, LZ4, LZW, LZF, ZFP, AEC, NPY, PNG, WebP, JPEG 8-bit, JPEG 12-bit, JPEG SOF3, JPEG 2000, JPEG LS, JPEG XR, JPEG XL, PackBits, Packed Integers, Delta, XOR Delta, Floating Point Predictor, Bitorder reversal, and Bitshuffle.

Author:

Christoph Gohlke

Organization:

Laboratory for Fluorescence Dynamics. University of California, Irvine

License:

BSD 3-Clause

Version:

2019.12.31

Requirements

This release has been tested with the following requirements and dependencies (other versions may work):

Required Python packages for testing (other versions may work):

Notes

The API is not stable yet and might change between revisions.

Works on little-endian platforms only.

Python 2.7, 3.5, and 32-bit are deprecated.

The Microsoft Visual C++ Redistributable Packages are required on Windows.

Refer to the imagecodecs/licenses folder for 3rd party library licenses.

This software is based in part on the work of the Independent JPEG Group.

This software includes modified versions of dcm2niix’s jpg_0XC3.cpp and OpenJPEG’s color.c.

Build instructions and wheels for manylinux and macOS courtesy of Grzegorz Bokota.

To install the requirements for building imagecodecs from source code on latest Ubuntu Linux distributions, run:

sudo apt-get install build-essential python3-dev cython3 python3-setuptools python3-pip python3-wheel python3-numpy python3-pytest python3-blosc python3-brotli python3-snappy python3-lz4 libz-dev libblosc-dev liblzma-dev liblz4-dev libzstd-dev libpng-dev libwebp-dev libbz2-dev libopenjp2-7-dev libjpeg-turbo8-dev libjxr-dev liblcms2-dev libcharls-dev libaec-dev libbrotli-dev libsnappy-dev libzopfli-dev

The imagecodecs package can be challenging to build from source code. Consider using the imagecodecs-lite package instead, which does not depend on external third-party C libraries and provides a subset of image codecs for the tifffile library: LZW, PackBits, Delta, XOR Delta, Packed Integers, Floating Point Predictor, and Bitorder reversal.

Other Python packages providing imaging or compression codecs:

Revisions

2019.12.31

Pass 3288 tests. Fix decoding of indexed PNG with transparency. Last version to support Python 2.7 and 3.5.

2019.12.16

Add Zopfli codec. Add Snappy codec. Rename j2k codec to jpeg2k. Rename jxr codec to jpegxr. Use Debian’s jxrlib. Support pathlib and binary streams in imread and imwrite. Move external C declarations to pxd files. Move shared code to pxi file. Update copyright notices.

2019.12.10

Add version functions. Add Brotli codec (WIP). Add optional JPEG XL codec via Brunsli repacker (WIP).

2019.12.3

Sync with imagecodecs-lite.

2019.11.28

Add AEC codec via libaec (WIP). Do not require scikit-image for testing. Require CharLS 2.1.

2019.11.18

Add bitshuffle codec. Fix formatting of unknown error numbers. Fix test failures with official python-lzf.

2019.11.5

Rebuild with updated dependencies.

2019.5.22

Add optional YCbCr chroma subsampling to JPEG encoder. Add default reversible mode to ZFP encoder. Add imread and imwrite helper functions.

2019.4.20

Fix setup requirements.

2019.2.22

Move codecs without 3rd-party C library dependencies to imagecodecs_lite.

2019.2.20

Rebuild with updated dependencies.

2019.1.20

Add more pixel formats to JPEG XR codec. Add JPEG XR encoder.

2019.1.14

Add optional ZFP codec via zfp library (WIP). Add numpy NPY and NPZ codecs. Fix some static codechecker errors.

2019.1.1

Update copyright year. Do not install package if Cython extension fails to build. Fix compiler warnings.

2018.12.16

Reallocate LZW buffer on demand. Ignore integer type output arguments for codecs returning images.

2018.12.12

Enable decoding of subsampled J2K images via conversion to RGB. Enable decoding of large JPEG using patched libjpeg-turbo. Switch to Cython 0.29, language_level=3.

2018.12.1

Add J2K encoder (WIP). Use ZStd content size 1 MB if it cannot be determined. Use logging.warning instead of warnings.warn or print.

2018.11.8

Decode LSB style LZW. Fix last byte not written by LZW decoder (bug fix). Permit unknown colorspaces in JPEG codecs (e.g. CFA used in TIFF).

2018.10.30

Add JPEG 8-bit and 12-bit encoders. Improve color space handling in JPEG codecs.

2018.10.28

Rename jpeg0xc3 to jpegsof3. Add optional JPEG LS codec via CharLS. Fix missing alpha values in jxr_decode. Fix decoding JPEG SOF3 with multiple DHTs.

2018.10.22

Add Blosc codec via libblosc.

2018.10.21

Builds on Ubuntu 18.04 WSL. Include liblzf in srcdist. Do not require CreateDecoderFromBytes patch to jxrlib.

2018.10.18

Improve jpeg_decode wrapper.

2018.10.17

Add JPEG SOF3 decoder based on jpg_0XC3.cpp.

2018.10.10

Add PNG codec via libpng. Add option to specify output colorspace in JPEG decoder. Fix Delta codec for floating point numbers. Fix XOR Delta codec.

2018.9.30

Add LZF codec via liblzf.

2018.9.22

Add WebP codec via libwebp.

2018.8.29

Add PackBits encoder.

2018.8.22

Add link library version information. Add option to specify size of LZW buffer. Add JPEG 2000 decoder via OpenJPEG. Add XOR Delta codec.

2018.8.16

Link to libjpeg-turbo. Support Python 2.7 and Visual Studio 2008.

2018.8.10

Initial alpha release. Add LZW, PackBits, PackInts and FloatPred decoders from tifffile.c module. Add JPEG and JPEG XR decoders from czifile.pyx module.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

imagecodecs-2019.12.31.tar.gz (3.5 MB view hashes)

Uploaded Source

Built Distributions

imagecodecs-2019.12.31-cp38-cp38-win_amd64.whl (2.9 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

imagecodecs-2019.12.31-cp38-cp38-win32.whl (2.5 MB view hashes)

Uploaded CPython 3.8 Windows x86

imagecodecs-2019.12.31-cp38-cp38-manylinux2010_x86_64.whl (13.1 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

imagecodecs-2019.12.31-cp38-cp38-manylinux2010_i686.whl (11.3 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ i686

imagecodecs-2019.12.31-cp38-cp38-macosx_10_13_x86_64.whl (8.5 MB view hashes)

Uploaded CPython 3.8 macOS 10.13+ x86-64

imagecodecs-2019.12.31-cp38-cp38-macosx_10_9_x86_64.whl (4.7 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

imagecodecs-2019.12.31-cp37-cp37m-win_amd64.whl (2.8 MB view hashes)

Uploaded CPython 3.7m Windows x86-64

imagecodecs-2019.12.31-cp37-cp37m-win32.whl (2.5 MB view hashes)

Uploaded CPython 3.7m Windows x86

imagecodecs-2019.12.31-cp37-cp37m-manylinux2010_x86_64.whl (12.4 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

imagecodecs-2019.12.31-cp37-cp37m-manylinux2010_i686.whl (10.8 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ i686

imagecodecs-2019.12.31-cp37-cp37m-macosx_10_13_intel.whl (8.5 MB view hashes)

Uploaded CPython 3.7m macOS 10.13+ intel

imagecodecs-2019.12.31-cp37-cp37m-macosx_10_9_intel.whl (5.5 MB view hashes)

Uploaded CPython 3.7m macOS 10.9+ intel

imagecodecs-2019.12.31-cp36-cp36m-win_amd64.whl (2.7 MB view hashes)

Uploaded CPython 3.6m Windows x86-64

imagecodecs-2019.12.31-cp36-cp36m-win32.whl (2.4 MB view hashes)

Uploaded CPython 3.6m Windows x86

imagecodecs-2019.12.31-cp36-cp36m-manylinux2010_x86_64.whl (12.4 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

imagecodecs-2019.12.31-cp36-cp36m-manylinux2010_i686.whl (10.8 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ i686

imagecodecs-2019.12.31-cp36-cp36m-macosx_10_13_intel.whl (8.5 MB view hashes)

Uploaded CPython 3.6m macOS 10.13+ intel

imagecodecs-2019.12.31-cp36-cp36m-macosx_10_9_intel.whl (5.5 MB view hashes)

Uploaded CPython 3.6m macOS 10.9+ intel

imagecodecs-2019.12.31-cp35-cp35m-win_amd64.whl (2.7 MB view hashes)

Uploaded CPython 3.5m Windows x86-64

imagecodecs-2019.12.31-cp35-cp35m-win32.whl (2.4 MB view hashes)

Uploaded CPython 3.5m Windows x86

imagecodecs-2019.12.31-cp35-cp35m-manylinux2010_x86_64.whl (12.3 MB view hashes)

Uploaded CPython 3.5m manylinux: glibc 2.12+ x86-64

imagecodecs-2019.12.31-cp35-cp35m-manylinux2010_i686.whl (10.7 MB view hashes)

Uploaded CPython 3.5m manylinux: glibc 2.12+ i686

imagecodecs-2019.12.31-cp35-cp35m-macosx_10_13_intel.whl (8.4 MB view hashes)

Uploaded CPython 3.5m macOS 10.13+ intel

imagecodecs-2019.12.31-cp35-cp35m-macosx_10_9_intel.whl (5.4 MB view hashes)

Uploaded CPython 3.5m macOS 10.9+ intel

imagecodecs-2019.12.31-cp27-cp27mu-manylinux2010_x86_64.whl (12.0 MB view hashes)

Uploaded CPython 2.7mu manylinux: glibc 2.12+ x86-64

imagecodecs-2019.12.31-cp27-cp27mu-manylinux2010_i686.whl (10.5 MB view hashes)

Uploaded CPython 2.7mu manylinux: glibc 2.12+ i686

imagecodecs-2019.12.31-cp27-cp27m-win_amd64.whl (3.5 MB view hashes)

Uploaded CPython 2.7m Windows x86-64

imagecodecs-2019.12.31-cp27-cp27m-win32.whl (3.2 MB view hashes)

Uploaded CPython 2.7m Windows x86

imagecodecs-2019.12.31-cp27-cp27m-manylinux2010_x86_64.whl (12.0 MB view hashes)

Uploaded CPython 2.7m manylinux: glibc 2.12+ x86-64

imagecodecs-2019.12.31-cp27-cp27m-manylinux2010_i686.whl (10.5 MB view hashes)

Uploaded CPython 2.7m manylinux: glibc 2.12+ i686

imagecodecs-2019.12.31-cp27-cp27m-macosx_10_13_intel.whl (8.5 MB view hashes)

Uploaded CPython 2.7m macOS 10.13+ intel

imagecodecs-2019.12.31-cp27-cp27m-macosx_10_9_intel.whl (5.5 MB view hashes)

Uploaded CPython 2.7m macOS 10.9+ intel

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page