JPEG XL: Another multi-page improvement

Hi, sorry for the long hiatus.. This MR proposed to update and fix some of the twist and kinks to our JPEG XL multi-page capabilities.

Export dialog update

Replace image mode checkboxes into a clearer radio selections with short tooltip descriptions on hover. This will hopefully make the image mode choices much clearer. While I'm at it, I also reset the UI default tab index to 0 so that the first tab is shown when exporting to JPEG XL (it was thrown to third tab (advanced) before when exporting, seems like a minor regression?).

Old New
old-ui new-ui

Note: The old one is from 5.2.9 where the lossless alpha option !2077 (merged) didn't exist yet.

Better import workflow for multi-page image

On prior MR !2263 (merged) , multi-page JPEG XL images will be imported as an animation frames. This MR changed that so that it will be properly imported as a layers instead.

Add multi-page image import unit test

Adding a simple unit test to verify multi-page images are imported properly.

Limitations

This however still didn't fully cover some other image modes that JPEG XL can provide, for example:

  • Multi-page animation: Image with multiple animations separated by page markers. In Krita, this image will be imported as a whole animation without separation.
  • Multi-layered animation: Animated image with multiple layers per animation frame. In Krita, this image will be imported as an animation where the layers are flattened / coalesced.

Lately, I've spent quite a bit of time exploring those modes and what libjxl can do currently. But some of them are rather complex to implement here yet... Therefore I put them into a separate personal project to test them: https://github.com/kampidh/JXL-Frame-Stitcher

Test Plan

  • Build Krita
  • Try to export some documents to JPEG XL image with different modes shown on the export UI (flattened, animated, multi-layered, and multi-paged)
  • Verify the resulting images are correctly saved
  • Verify multi-paged images are correctly imported on Krita

Formalities Checklist

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

Loading