Closed Traneptora closed 1 month ago
Thank you for reporting this issue. We will try to investigate this issue. We also recommend that you report this issue to upstream.
@Traneptora
I won't be able to report it upstream because Firefox doesn't support JXL. Mercury relies on unmerged patches that are on mozilla's bug tracker to support it.
Consider the following image: https://people.csail.mit.edu/ericchan/hdr/jxl_images/20140606_102418_IMGP0297.jxl
This image is an HDR image tagged with BT.2100 primaries and PQ transfer. Mercury appears to be requesting BT.2100/PQ pixel data from libjxl, and then subsequently rendering that pixel data as though it were sRGB pixel data, which is incorrect. My monitor is SDR/sRGB.
Possible solutions: (1) Request BT.2100/PQ and then send it through the color management engine as BT.2100/PQ (2) Request sRGB from libjxl anyway, if sRGB needs to be the final target.
Somewhere along the line, HDR pixel data is being requested from libjxl and then it's being treated as though it were sRGB. You can do this explicitly by decoding the image with djxl via:
and then use a utility like tweakpng or umbrielpng to strip the cICP chunk and replace it with an sRGB chunk.
Then, if you view the sRGB-tagged image in an image viewer, you can see that it looks exactly like the JXL file does when displayed via mercury, which means this is the problem that's occurring in the render pipeline somewhere.