cgohlke / imagecodecs

Image transformation, compression, and decompression codecs
https://pypi.org/project/imagecodecs
BSD 3-Clause "New" or "Revised" License
118 stars 23 forks source link

libjxl v0.7rc1 #46

Closed JackKelly closed 2 years ago

JackKelly commented 2 years ago

Thanks again for all your work on imagecodecs!

After almost a year since the release of libjxl v0.6.1, v0.7rc of libjxl has been released. (libjxl is the reference implementation of the JPEG XL codec).

I plan to experiment with using imagecodecs and libjxl v0.7rc over the coming weeks. If I find that any changes are necessary to the imagecodecs code to make it compatible with libjxl v0.7rc then should I submit a PR to imagecodecs?

I guess my main question is to ask whether you're already working on updating imagecodecs to work with libjxl v0.7, because I don't want to duplicate your work! (No worries either way, I know you're busy!)

(To give some context: I'm working on trying to store a 12-channel satellite image in a single JPEG XL file, using imagecodecs, Zarr, and xarray).

cgohlke commented 2 years ago

I already moved the development version of imagecodecs to libjxl 0.7. However, I am still struggling with multi-channel support. As far as I understood, libjxl requires the color and primary alpha channels/samples to be interleaved/contig (JxlEncoderAddImageFrame), while additional channels are separate/planar (JxlEncoderSetExtraChannelBuffer). That does not fit well with the imagecodecs/zarr model and would complicate the implementation. For now I'll probably restrict multi-channel support to grayscale without primary alpha, where all channels are separate/planar...

JackKelly commented 2 years ago

That's great news that you've already moved the development version of imagecodecs to libjxl v0.7! Thank you!

If it's any use, I've been having a detailed conversation with Jon Sneyers over on reddit. (I expect you know Jon already but, if not: Jon is one of the main JPEG XL developers). The conversation is mostly about multi-channel images in JPEG XL. But we haven't directly addressed your point.

For now I'll probably restrict multi-channel support to grayscale without primary alpha, where all channels are separate/planar

That sounds good to me! That would work well for my use-case :slightly_smiling_face: Thank you!

Would you be happy to share the dev version of imagecodecs? No worries if not... I'm not in a huge rush, so I'm happy to wait until the next version of imagecodecs is released!

cgohlke commented 2 years ago

Rudimentary support for multi-channel (planar grayscale only) and multi-frame JPEG XL was added to imagecodecs 2022.9.26.