Skip to content

opencodecs 0.7.1

Choose a tag to compare

@kevinjohncutler kevinjohncutler released this 04 Oct 11:29
· 20 commits to main since this release

opencodecs 0.7.1 is about files that open in other software, not just in opencodecs.

Every encoder is now tested against a decoder that is not ours. Each of the 46 codecs that can encode writes a stream, and an independent library reads it back:

  • the format's own Python binding where one exists (zstandard, lz4, brotli, blosc2, cramjam, lerc, zfpy, pcodec, qoi, pillow-heif, the standard library);
  • imagecodecs;
  • format readers (tifffile, mrcfile, nibabel, pydicom, numcodecs, numpy).

Every writer's files are opened the same way: TIFF with each compression, pyramids, NDTiff, OME-Zarr, MRC, NIfTI, RGBE, JPEG XL animation and CZI. CZI files are additionally checked with libCZI (pylibCZIrw), czifile and aicspylibczi. A codec that gains an encoder without such a test fails the suite.

Fixes this found

  • CZI files written with the default metadata could not be opened by libCZI, so neither by czicompress nor by ZEN. The writer now always roots the metadata at ImageDocument, which libCZI requires. czi_recompress keeps the source metadata unchanged.
  • OME-Zarr stores written with compressor="blosc2" opened only in opencodecs. They now carry the metadata of ocf-blosc2, the numcodecs plugin for Blosc2, so zarr opens them with that plugin installed. Stores written the old way still read.
  • TiffWriter and the NDTiff writer raised for JPEG XL with compression_level. JPEG XL now takes level with imagecodecs' meaning: 100 or below is lossy at that quality, above 100 is lossless.
  • On Windows, a closed CZI reader raised ValueError: mmap closed or invalid instead of its own closed-reader error.

The full list, including why the CZI zstd level stays at 3, is in CHANGES.rst.