Bug 458054

Summary: Failed to export to JPEG-XL with 16-bit integer image
Product: [Applications] krita Reporter: Kampidh <qampidh>
Component: File formatsAssignee: amyspark <amy>
Status: RESOLVED FIXED    
Severity: minor CC: amy
Priority: NOR    
Version: 5.1.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Error window

Description Kampidh 2022-08-19 06:03:54 UTC
Created attachment 151420 [details]
Error window

SUMMARY
Exporting from 16-bit integer image to jxl format yields an error. However, 8-bit image can still be exported successfully.
Float (16/32-bit) doesn't work as well, but I presume this is an upcoming feature for HDR images that hasn't been enabled as described on Krita 5.1 release notes?

STEPS TO REPRODUCE
1.  Load an image with 16-bit color depth
2.  Export to jpeg-xl (jxl) format

OBSERVED RESULT
Result shown on attached image

SOFTWARE/OS VERSIONS
Windows: 10 Pro 21H2 64bit
Qt Version: 5.12.12
Comment 1 amyspark 2022-08-19 12:30:32 UTC
> Float (16/32-bit) doesn't work as well, but I presume this is an upcoming feature for HDR images that hasn't been enabled as described on Krita 5.1 release notes?

Correct, that's bug 454283 which I'm working on.
Comment 2 Kampidh 2022-08-22 13:49:45 UTC
(In reply to amyspark from comment #1)
> > Float (16/32-bit) doesn't work as well, but I presume this is an upcoming feature for HDR images that hasn't been enabled as described on Krita 5.1 release notes?
> 
> Correct, that's bug 454283 which I'm working on.

Alright, thank you for the clarification. I'll be looking forward for it! Best of luck!
Comment 3 Bug Janitor Service 2022-08-25 12:35:33 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1557
Comment 4 amyspark 2022-08-25 14:00:31 UTC
*** Bug 454283 has been marked as a duplicate of this bug. ***
Comment 5 amyspark 2022-08-25 14:16:08 UTC
Git commit a980e15180e34cdafac7ecb0f61320a020e77fd3 by L. E. Segovia.
Committed on 25/08/2022 at 13:46.
Pushed by lsegovia into branch 'master'.

JPEG-XL: fix float16 import

M  +27   -14   plugins/impex/jxl/JPEGXLImport.cpp

https://invent.kde.org/graphics/krita/commit/a980e15180e34cdafac7ecb0f61320a020e77fd3
Comment 6 amyspark 2022-08-25 14:16:16 UTC
Git commit 879710db19f211b42f743a8fde088558d9bc6637 by L. E. Segovia.
Committed on 25/08/2022 at 13:46.
Pushed by lsegovia into branch 'master'.

JPEG-XL: fix linear HDR export

The version of libjxl we were using had broken support for HDR,
and updating it revealed some last-minute ABI breaks upstream.

To fix it, I'm updating libjxl to the 0.7 RC and highway to latest main.

M  +5    -7    3rdparty/ext_jpegxl/CMakeLists.txt
D  +0    -14   3rdparty/ext_jpegxl/disable-jxl_extras.patch
M  +21   -8    plugins/impex/jxl/JPEGXLExport.cpp

https://invent.kde.org/graphics/krita/commit/879710db19f211b42f743a8fde088558d9bc6637
Comment 7 amyspark 2022-08-25 14:17:40 UTC
Git commit 8c36840bc2a761f400cd57f2594e052066171dab by L. E. Segovia.
Committed on 25/08/2022 at 14:17.
Pushed by lsegovia into branch 'krita/5.1'.

JPEG-XL: fix linear HDR export

The version of libjxl we were using had broken support for HDR,
and updating it revealed some last-minute ABI breaks upstream.

To fix it, I'm updating libjxl to the 0.7 RC and highway to latest main.
(cherry picked from commit 879710db19f211b42f743a8fde088558d9bc6637)

M  +5    -7    3rdparty/ext_jpegxl/CMakeLists.txt
D  +0    -14   3rdparty/ext_jpegxl/disable-jxl_extras.patch
M  +21   -8    plugins/impex/jxl/JPEGXLExport.cpp

https://invent.kde.org/graphics/krita/commit/8c36840bc2a761f400cd57f2594e052066171dab
Comment 8 amyspark 2022-08-25 14:17:48 UTC
Git commit 96d42652a6ffbe92e6ad085e0e5e8b5f46559800 by L. E. Segovia.
Committed on 25/08/2022 at 14:17.
Pushed by lsegovia into branch 'krita/5.1'.

JPEG-XL: fix float16 import
(cherry picked from commit a980e15180e34cdafac7ecb0f61320a020e77fd3)

M  +27   -14   plugins/impex/jxl/JPEGXLImport.cpp

https://invent.kde.org/graphics/krita/commit/96d42652a6ffbe92e6ad085e0e5e8b5f46559800
Comment 9 amyspark 2022-11-01 18:21:29 UTC
Git commit ff487eb77f0b787869a6d103bbf23aed3149a45f by L. E. Segovia.
Committed on 01/11/2022 at 18:19.
Pushed by lsegovia into branch 'master'.

JPEG-XL: implement HDR as CICP import/export

Google Chrome refuses to recognize ICC linear HDR profiles (aka Elle's)
as valid HDR profiles, nor can we read fully CICP'd images... so let's
import images the AVIF way, and export them the same way (or with ICC,
if the transfer function is sufficiently cursed).

M  +377  -50   plugins/impex/jxl/JPEGXLExport.cpp
M  +272  -74   plugins/impex/jxl/JPEGXLImport.cpp
M  +84   -0    plugins/impex/jxl/kis_wdg_options_jpegxl.cpp
M  +4    -0    plugins/impex/jxl/kis_wdg_options_jpegxl.h
M  +89   -2    plugins/impex/jxl/kis_wdg_options_jpegxl.ui

https://invent.kde.org/graphics/krita/commit/ff487eb77f0b787869a6d103bbf23aed3149a45f
Comment 10 amyspark 2022-11-01 20:30:45 UTC
Git commit d37295d2070006e8251260302d3c5f1f728edcf2 by L. E. Segovia.
Committed on 01/11/2022 at 20:05.
Pushed by lsegovia into branch 'krita/5.1'.

JPEG-XL: implement HDR as CICP import/export

Google Chrome refuses to recognize ICC linear HDR profiles (aka Elle's)
as valid HDR profiles, nor can we read fully CICP'd images... so let's
import images the AVIF way, and export them the same way (or with ICC,
if the transfer function is sufficiently cursed).
(cherry picked from commit ff487eb77f0b787869a6d103bbf23aed3149a45f)

M  +1    -1    libs/pigment/KoColorTransferFunctions.h
M  +377  -50   plugins/impex/jxl/JPEGXLExport.cpp
M  +272  -74   plugins/impex/jxl/JPEGXLImport.cpp
M  +84   -0    plugins/impex/jxl/kis_wdg_options_jpegxl.cpp
M  +4    -0    plugins/impex/jxl/kis_wdg_options_jpegxl.h
M  +89   -2    plugins/impex/jxl/kis_wdg_options_jpegxl.ui

https://invent.kde.org/graphics/krita/commit/d37295d2070006e8251260302d3c5f1f728edcf2