JXL Embedded ICC profile is not detected correctly.

Older bugs which are supposed to be fixed in 0.84. *** Please try to reproduce your bug and confirm the bug fix. ***

Moderators: XnTriq, helmut, xnview, Dreamer

bouncyball
Posts: 9
Joined: Fri Mar 08, 2024 5:26 pm

JXL Embedded ICC profile is not detected correctly.

Post by bouncyball »

Hello everyone,

Since version 1.6.2 JXL Embedded ICC profile is not detected correctly.

Jpeg XL has builtin profile naming. For example RGB_D65_DCI_Per_SRG means: color is RGB, WB is D65, Color primaries are DCI-P3, Intent is Perceptual and Transfer Function is sRGB. Rec2020 is coded as RGB_D65_202_Per_709 and so on.

When used lossy compression internally Jpeg XL uses XYB color space. After recovering from XYB to RGB data has to be converted to original space according to ICC.

From 1.6.2 and up xnView MP assumes profile "RGB_D65_SRG_Rel_SRG" for DCI-P3 and rec2020 images and "RGB_D65_SRG_Per_SRG" for sRGB images. In fact only srgb images are treated right. Not only metadata is shown incorrectly also color management is off because of this assumption.

The last version which worked correctly was 1.6.1.

To reproduce get these sample files I provided here and try to switch color management On and Off in the settings and view the image. When CM is on colors of every image have to be correct and identical, when CM is off (and monitor is srgb) colors should be wrong for bigger color gamuts like P3 or 2020. Which is not the case after 1.6.2. Also compare file properties when viewing with v1.6.1 and later versions. Profile names are different and seams they clumped to sRGB.

Best Regards
bb
Last edited by bouncyball on Wed Apr 03, 2024 6:03 am, edited 7 times in total.
bouncyball
Posts: 9
Joined: Fri Mar 08, 2024 5:26 pm

Re: JXL Embedded ICC profile is not detected correctly.

Post by bouncyball »

BTW I saw these issue viewtopic.php?f=62&t=46279 and its solution https://www.xnview.com/mantisbt/view.ph ... 52#history.

I guess trying to make HDR images showing up ""correctly"" can be the real issue.
I have DCI-P3 D65 (aka Display P3) calibrated/profiled monitor and color management was flawless until fix in 1.6.2.

This all said for non HDR images on SDR monitor. HDRs have to be treated separately with appropriate tone mapping for particular display device: HDR or SDR.

regards
bb
bouncyball
Posts: 9
Joined: Fri Mar 08, 2024 5:26 pm

Re: JXL Embedded ICC profile is not detected correctly.

Post by bouncyball »

One more thing:

We can replace libJPEGXL.dll with one from 1.6.1. This simple trick works nicely up to 1.6.5 but not for 1.7. In this case plugin is crashing and JXL image can not be shown.

BTW Jpeg XL code of this plugin is quite old.
User avatar
xnview
Author of XnView
Posts: 44470
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: JXL Embedded ICC profile is not detected correctly.

Post by xnview »

and with 1.7.0?
Pierre.
bouncyball
Posts: 9
Joined: Fri Mar 08, 2024 5:26 pm

Re: JXL Embedded ICC profile is not detected correctly.

Post by bouncyball »

If you mean whether works all said above with 1.7 or not then answer is NO. The same problem as in 1.6.2-1.6.5. Detected profile is wrong.
but
If you mean the trick replacing the plugin only, this works up to 1.6.5 but in 1.7 plugin crashes and file is not shown.

All testing done in windows 11.
Last edited by bouncyball on Thu Apr 04, 2024 8:58 am, edited 1 time in total.
mahepeha
Posts: 2
Joined: Wed Apr 03, 2024 5:48 pm

Re: JXL Embedded ICC profile is not detected correctly.

Post by mahepeha »

Hello everyone,

also having problems with jxl-files. They're simply not shown anymore in XnView 1.7.0 64 bit- MacOSX Libformat 7.174. Exif Tool in the "Info"-panel says: "Unknown file type". This is unfortunate, because I wanted to use JPEG XL to dramatically reduce the disk space used for archival purposes. In my case, the jxl-files were created form TIFFs using Affinity Photo 2.4.1 under MacOSX 12.7.4 Monterey. Same result under 14.4.1 Sonoma. Strangely enough the *Finder* under 14.4.1 Sonoma CAN display jxl-thumbnails (though they can't be opened in Preview), and Pixelmator Pro 3.5.7 opens the files themselves no problem (though it doesn't export into the format, lol). – All in all the status with JPEG XL looks pretty messy on MacOSX.

Bestest,

Marcus
User avatar
xnview
Author of XnView
Posts: 44470
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: JXL Embedded ICC profile is not detected correctly.

Post by xnview »

:bugconfirmed: Thanks to your detailed description I can reproduce the problem.
Pierre.
User avatar
xnview
Author of XnView
Posts: 44470
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: JXL Embedded ICC profile is not detected correctly.

Post by xnview »

This problem is supposed to be fixed in XnView MP 1.7.2. Please check and confirm the bug fix here.
Pierre.
bouncyball
Posts: 9
Joined: Fri Mar 08, 2024 5:26 pm

Re: JXL Embedded ICC profile is not detected correctly.

Post by bouncyball »

Thank you for the updated version.

Unfortunately 1.7.2 did not fix the issue explained above. Color profile section of the picture properties shows "RGB_D65_SRG_Per_SRG" (sRGB) on all photos regardless of the real profile it has in it and treats them as sRGB color space data. Check with sample jxl files I uploaded in the first post.

Also you can check the real color space of the pic with "jxlinfo.exe" utility from here https://github.com/libjxl/libjxl/releas ... static.zip.

Best regards,
bb
User avatar
xnview
Author of XnView
Posts: 44470
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: JXL Embedded ICC profile is not detected correctly.

Post by xnview »

The issue is partially fixed, DCI-P3.jxl & Rec2020.jxl show now correct color profile but not 16bits version... Profile for 16bits need to be converted
Pierre.
bouncyball
Posts: 9
Joined: Fri Mar 08, 2024 5:26 pm

Re: JXL Embedded ICC profile is not detected correctly.

Post by bouncyball »

Edit: My bad, I didn't tested 8 bit files. You are right, works for them, but not for 16bits.

Great, can I try that new build? Or maybe you are talking about 1.7.2?
mahepeha
Posts: 2
Joined: Wed Apr 03, 2024 5:48 pm

Re: JXL Embedded ICC profile is not detected correctly.

Post by mahepeha »

xnview wrote: Wed Apr 17, 2024 7:33 am :bugconfirmed: Thanks to your detailed description I can reproduce the problem.
Thank you for the new version. I don't know about 8bit/16bit and color spaces, but my problem (no show of .jxl thumbnails) has been solved.

Thank you for all your work, thank you for xnview!
bouncyball
Posts: 9
Joined: Fri Mar 08, 2024 5:26 pm

Re: JXL Embedded ICC profile is not detected correctly.

Post by bouncyball »

Using ver. 1.8.0.

Still not showing correct color profile for 16 bit files.

Regards
bb
bouncyball
Posts: 9
Joined: Fri Mar 08, 2024 5:26 pm

Re: JXL Embedded ICC profile is not detected correctly.

Post by bouncyball »

I guess xnviewmp internally has 8 bit processing pipeline and 16 bit images are converted to 8 bit before any manipulation. Right?
Is it impossible to correct this 16 bit JXL color profile issue?

I don't wanna archive 8 bit files because JpegXL it so good that 16 bit files are about the same size as 8 bit ones with benefit of having 65535 gradations per channel. I usually export Rec2020 16 bit and need correct color management in my preview on P3 calibrated monitor. 16 bit JXL files appear as SRGB ones and are not showing correctly on P3 calibrated monitor.
bouncyball
Posts: 9
Joined: Fri Mar 08, 2024 5:26 pm

Re: JXL Embedded ICC profile is not detected correctly.

Post by bouncyball »

There are 2 ways to deal with colorspace of a JXL codestream.

When exporting to AdobeRGB or ProphotoRGB Lightroom always produces lossless JXLs with ICC profiles and those files interpreted by color management of xnviewmp without problem.

If JXL is lossy by defaul it uses CICP-style Enum values. That is what I'm talking about.

Here is the related part from the documentation.
Color Management

In JPEG XL, images always have a fully defined colorspace, i.e. it is always unambiguous how to interpret the pixel values. There are two options:

Pixel data is in a specified (non-XYB) colorspace, and the decoder will produce a pixel buffer in this colorspace plus an ICC profile that describes that colorspace. Mathematically lossless encoding can only use this option.
Pixel data is in the XYB colorspace, which is an absolute colorspace. In this case, the decoder can produce a pixel buffer directly in a desired display space like sRGB, Display-P3 or Rec.2100 PQ.

The image header always contains a colorspace; however, its meaning depends on which of the above two options were used:

In the first case (non-XYB), the signaled colorspace defines the interpretation of the pixel data.
In the second case (XYB), the signaled colorspace is merely a suggestion of a target colorspace to represent the image in, i.e. it is the colorspace the original image was in, that has a sufficiently wide gamut and a suitable transfer curve to represent the image data with high fidelity using a limited bit depth representation.

Colorspaces can be signaled in two ways in JPEG XL:

CICP-style Enum values: This is a very compact representation that covers most or all of the common colorspaces. The decoder can convert XYB to any of these colorspaces without requiring an external color management library.
ICC profiles: Arbitrary ICC profiles can also be used, including CMYK ones. The ICC profile data gets compressed. In this case, external color management software (e.g. lcms2 or skcms) has to be used for color conversions.