Closed Bug 1555331 Opened 2 years ago Closed 3 months ago

ICCv4 profiles look oversaturated with some display profiles


(Core :: GFX: Color Management, defect, P2)




90 Branch
Tracking Status
firefox69 --- wontfix
firefox90 --- fixed


(Reporter: aosmond, Assigned: aosmond)


(Blocks 3 open bugs)



(9 files)

I performed a mozregression checking an unrelated ICCv4 profile issue, and inadvertently discovered that the profiles display differently between Wayland and X11.


  1. Login into Ubuntu 18.04 with Wayland.
  2. Start Firefox normally, browse to and note that the ICCv4 profile parts of the image appears oversaturated.
  3. Start Firefox with MOZ_ENABLE_WAYLAND=1, browse to and note that it appears correct.

I had observed this before, but I assumed it was due to qcms's transform being wrong rather than it being somehow dependent on the windowing system.

Assignee: nobody → aosmond
OS: Unspecified → Linux
Priority: -- → P3
Hardware: Unspecified → Desktop

Bug 1555329 is necessary to reproduce on recent builds due to the regression.

Depends on: 1555329

Okay, it looks like we force sRGB with Wayland, since we don't support getting the color profile. We may still be misprocessing the X11 profile, or the system gave me the wrong one in the first place. Forcing sRGB without Wayland corrects the output.

Comparing in GIMP and Chrome, it appears they decode correctly with the same display profile as me. This suggests it is QCMS.

Attached file Sharp ICC profile

I see the behaviour on several color profiles, as attached.

Attached file Thinkpad ICC profile

Jeff reproduced this on his Mac with my laptop profile, so I think this can happen on any platform.

OS: Linux → All
Summary: ICCv4 profiles look correct with Wayland, and wrong with X11 → ICCv4 profiles look oversaturated with some color profiles
Priority: P3 → P2
Summary: ICCv4 profiles look oversaturated with some color profiles → ICCv4 profiles look oversaturated with some display profiles
Attached file ASUS profile
Duplicate of this bug: 1582955

ICC v2 profile with Firefox color management enabled is not fine too : fine gradiant get heavy solarized rendering, crushing fine gradiant into ugly 8bit ugly files, and a serious bump in the gamma

Duplicate of this bug: 1587236
Blocks: 1601020
Blocks: 1602453

It looks like the problem here is around build_output_lut for parametric curves. We don't seem to be inverting the lut when we should be.

This makes our parsing of parametric transfer functions
more clear because you can see exactly what output variables
the input variables map to.

This also adjusts the initialization of Param to make inversion better behaved.

Previously we didn't invert at all which was causing over saturation.

Pushed by
Add a Param struct. r=aosmond
Implement analytic inversion for parametric transfer functions. r=aosmond
Use parametric inversion when building an output_lut. r=aosmond
Add a test that parametric functions are properly inverted. r=aosmond
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.