Add JXL support - #2917
Conversation
d5db4bb to
8adc664
Compare
|
I think it's done. However, maybe it comes at a wrong time, with all the CMake stuff being refreshed… |
|
I just found out that the JXL decoder handles the EXIF orientation automatically, so we don't need to do anything to support this here.
Just tried on a JPEG that had EXIF orientation: cjxl image.jpg image.jxlBy the default, it will be in lossless JPEG mode and store necessary information to reconstruct the JPEG. Then, if I call Note that we can reconstruct the exact JPEG image with: djxl image.jxl image-rec.jpgAnd the MD5SUM of |
The setting is ignored where it does not make sense.
|
OK, now it's done for real: added Python bindings and updated imglab, too. |
Co-authored-by: Davis E. King <davis685@gmail.com>
Co-authored-by: Davis E. King <davis685@gmail.com>
|
Done. If I (or someone) have the need for more JPEG XL features at some point, I will add them:
|
|
Nice, this is sweet. |
This PR adds basic support for the JPEG XL format: loading and saving JXL images from and to all supported dlib pixel formats with appropriate conversions.
The utility of this PR is limited, since it can already be done with
dlib::ffmpeg::load_frameanddlib::ffmpeg::save_frame. However, as far as I can tell, it's not possible to store true grayscale or lossless images with that (even with-distance 0 -modular 1).Moreover, I intend to use JXL for all my datasets from now on, since I will save about 20-40% of disk space with reversible pixel perfect conversion from JPEG and PNG. All that while decoding images faster than libjpeg-turbo.
So, I might add more features specific to JPEG XL in the future (animations, grayscale + alpha, lossless JPEG transcoding).