Skip to content

opencodecs 0.5.0

Choose a tag to compare

@kevinjohncutler kevinjohncutler released this 02 Oct 20:42
· 39 commits to main since this release

opencodecs 0.5.0 brings two things: speed, above all on Windows, and a compatibility pass over every codec opencodecs shares with imagecodecs.

Speed. The speed changes are the same code on every operating system and compiler. Against the 0.4.0 wheels:

  • Delta and XOR decode, distances 2 to 4: 4.3 to 5.1x on Windows, 6.1 to 6.7x on Linux and 2.2 to 2.5x on the Mac.
  • LZW decode: 2.8 to 3.2x.
  • Bit-packed unpack: 1.7 to 4.6x.
  • Byte shuffle and bitshuffle on Windows: 1.7 to 2.3x.
  • BC7 decode: 1.14 to 1.55x.
  • Linux wheels now build their codec libraries from source. Earlier Linux wheels shipped AlmaLinux 8's zstd 1.4.4, lz4 1.8.3, libwebp 1.0 and openjpeg 2.4, plus a libdeflate built by GCC 8. Serial reads of deflate TIFFs on Linux are 1.2 to 1.5x faster. With the old libraries, 58 compatibility tests failed against the Linux wheel; they now pass.

The README's tables compare opencodecs with tifffile and with imagecodecs 2026.8.16 on macOS, Linux and Windows.

Compatibility. An audit found 54 cases where opencodecs and imagecodecs disagreed, and all of them are fixed under one rule:

  • A published specification wins.
  • A library's own format is written bare, with no opencodecs header, and files that earlier versions wrote still read.
  • Where no specification decides, opencodecs matches imagecodecs.
  • No parameter is silently ignored and no data is silently lost.

Several of these fixes change the bytes opencodecs writes: floatpred now implements TIFF predictor 3, float delta works on bit patterns (pass legacy_float=True to read old streams), and rcomp, aec, pcodec, SZ3 and SPERR drop their private headers. CHANGES.rst names each one.

Removed: opencodecs.tifffile_patch. tifffile 2026.8.23 and later refuse codec functions from other modules. Use opencodecs.read, opencodecs.tiff_imwrite and opencodecs.TiffWriter instead.

Known issues

  • BC3 decode is 0.80x of 0.4.0 on the Mac, because its alpha now rounds as the Khronos specification defines.
  • Built from source against libheif 1.23, HEIF alpha stored at a different depth from the color is rescaled, and its low bits are lost. The wheels ship libheif 1.21, which raises instead.
  • Built from source against OpenJPH older than 0.31, HTJ2K refuses a quality level. Older system OpenJPH and SZ3 builds also write bytes that differ from the wheels.
  • opencodecs.read cannot open lossless YCbCr JPEG TIFFs; it raises.
  • SZ3 can crash on a damaged payload.
  • On Linux, SZ3 and SPERR output can differ in its bytes from imagecodecs' own builds of the same libraries. Both are lossy float compressors.
  • The Linux wheels decode AVIF and HEIF but do not encode them, as in earlier releases.

The full list is in CHANGES.rst.