Skip to content

JPEG-XL: bump libjxl to 0.10.0 and add additional export options

This MR proposes a few more improvement to JPEG-XL:

Bump libjxl to 0.10.0

This version of libjxl mainly brings speed improvement, especially exporting lossless with large images using effort >3. Here's some test using libjxl binaries with 8bpc 36MP photography image on i7-12700KF:

libjxl 0.9.2 libjxl 0.10.0
libjxl092 libjxl0100

Add option to use CICP rather than ICC for lossless export

This option will try to strip ICC profile on lossless export and saving it as an equivalent CICP enums instead. Useful to squeeze down filesize even more (eg. for web delivery, like on small UI images where ICC profile can contribute to a bigger storage than the image data itself). If the profile cannot be converted to CICP, it will keep saving as ICC.

Add option for lossless alpha on lossy export

Before libjxl 0.10.0, alpha channel will follow quality / distance setting on lossy. This is not the case for 0.10.0+ and defaults to lossless alpha to prevent transparency artifacts for a cost of possible bigger filesize. This option will give user an explicit option whether to stay with lossy alpha or use lossless alpha. However, this API (separate extra channel quality setting) only available on libjxl 0.9.0+, so this option will simply get disabled if compiled with version less than that.

Extra: add version info on log display during exporting.

Test Plan

  • Build Krita
  • Verify the JPEG-XL export functions added on this MR is working as expected (lossless with CICP profile, lossy with and without lossless alpha)

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.

Reminder: the reviewer is responsible for merging the patch, this is to ensure at the least two people can build the patch. In case a patch breaks the build, both the author and the reviewer should be contacted to fix the build. If this is not possible, the commits shall be reverted, and a notification with the reasoning and any relevant logs shall be sent to the mailing list, kimageshop@kde.org.

Merge request reports