Closed Bug 1250461 Opened 4 years ago Closed 2 years ago

ICC profile (Late 2015 iMac with P3 Retina display)

Categories

(Core :: Graphics, defect, P3)

45 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox56 --- wontfix
firefox57 --- fixed
firefox58 --- fixed

People

(Reporter: patrik.bajer, Assigned: jrmuizel)

Details

(Whiteboard: [gfx-noted])

Attachments

(4 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Firefox/45.0
Build ID: 20160221141421

Steps to reproduce:

Open any website


Actual results:

All images are oversaturated. Firefox doesnt respect system dispaly ICC profile. 


Expected results:

Support ICC profiles correctly :-)
Component: Untriaged → Graphics
Product: Firefox → Core
Whiteboard: [gfx-noted]
This will likely work if you set 'gfx.color_management.enablev4'. If so this is a dupe of supporting ICC v4.
@ Benoit - I have tried it but it will not help / solve the issue.
I have this problem on my late 2015 wide-gamut iMac as well. Firefox seems to be completely ignoring the iMac's display profile. Which means absolutely no color management is happening and all images whether ICC-tagged or untagged are oversaturating. I've played with the gfx.color_management.mode and gfx.color_management.enablev4 settings to no avail.

I found this Chromium bug which seems to describe the same symptoms (https://bugs.chromium.org/p/chromium/issues/detail?id=562951). The problem they found was that the browser was rejecting the iMac display profile because the profile contained an unexpected negative XYZ value. Their solution was to allow negative values for Macs. Seems like a good place to start looking for the problem.
I wanted to add, after looking at it further, Firefox is actually doing color management, but it's assuming the monitor is sRGB. So skin tones and other colors get oversaturated. Makes it hard to look at.
Any news on this being fixed? It's really a shame that Firefox is not doing proper color management on the mac.
Now that all the new Macbook Pros are using wide-gamut P3 displays, this problem's scope of impact is only going to get bigger and bigger. It will cover all 4K and 5K iMacs, and all new Macbook Pros. (I would bet the 12" Macbook will get a P3 display whenever it's next refreshed, too.)

For an explanation of Apple's wide gamut implementation and why there are negative xyz numbers, see this WWDC talk: https://developer.apple.com/videos/play/wwdc2016/712/
As of May 2017, Safari and Chrome 58 both support proper color management (Chrome doesn't yet support limiting color ranges for CSS colors but only images) on Mac with a wide-gamut P3 display.

Firefox still doesn't handle color profiles properly at all, displaying all images regardless of what color profile it has embedded and colors specified by CSS oversaturated (expanded to full range of display color gamut).

I think it's about time if this issue is given some more priority because more and more people are going to get their hands on a wide-gamut display, and if colors are oversaturated and inaccurate it's not something you're going to want for the users to experience.
On my 15" 2016 MBPro the colours are so glaringly over-saturated it hurts my eyes. As a designer I can't really use Firefox for work now… What a shame.
I can confirm that this is happening on my 2016 13" MBP (P3 display), and not just for images with embedded color profiles.  The color space of all of Firefox is set to sRGB rather than the system's color profile, regardless of what color_management_* settings are chosen.

The fix:

I compiled Firefox with the Chromium team's patch to qcms/src/iccread.c -- described at https://bugs.chromium.org/p/chromium/issues/detail?id=562951 -- applied.  This fixed all of the issues described in this bug.  Firefox is rejecting color profiles with negative colorant tristiumlus values. Macs with P3 displays have negative values in the ICC profile.  This patch is where the issue originated:  https://bugzilla.mozilla.org/show_bug.cgi?id=498245#c18

I've attached a screenshot (attachment 8915020 [details] ) showing the behavior.  The top window is Firefox with the patch applied, the middle window is Chrome and the bottom window is Firefox without the patch.

Can someone apply the patch described at https://bugs.chromium.org/p/chromium/issues/detail?id=562951 to QCMS or fix this issue in some other way?  The patch fixes the issue.  Right now millions of people have Macs with P3 displays and are seeing oversaturated / inaccurate color in Firefox.
Milan, might we get this at least into 58, since we have a potential patch (linked to in comment 11)?
It sounds like this may be affecting more and more Mac users with the default MacBook out of the box.  

Jeff, what do you think?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(milan)
Flags: needinfo?(jmuizelaar)
Sounds like a plan. Will have a patch this week.
It seems like taking this patch will be fine. I'll put it together.
Flags: needinfo?(jmuizelaar)
Assignee: nobody → jmuizelaar
Attachment #8917164 - Flags: review?(mstange)
Attachment #8917164 - Flags: review?(mstange) → review+
Comment on attachment 8917164 [details] [diff] [review]
Do the chrome thing

Approval Request Comment
[Feature/Bug causing the regression]: 460629
[User impact if declined]: New Macs or those with new displays will get oversaturated colours with Firefox.
[Is this code covered by automated tests?]:
[Has the fix been verified in Nightly?]:
[Needs manual test from QE? If yes, steps to reproduce]: 
[List of other uplifts needed for the feature/fix]:
[Is the change risky?]: No, this change has been in Chromium for a while now
[Why is the change risky/not risky?]:
[String changes made/needed]:
Flags: needinfo?(milan)
Attachment #8917164 - Flags: approval-mozilla-beta?
Comment on attachment 8917164 [details] [diff] [review]
Do the chrome thing

Fix affecting newer Macs, doesn't look risky, let's take it for beta 8.
Attachment #8917164 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Pushed by jmuizelaar@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/319d79157004
Don't reject profiles with negative colorant tristiumlus value on macOS. r=mstange
https://hg.mozilla.org/mozilla-central/rev/319d79157004
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
I'm not seeing this fixed in Firefox 59.0.2 or 61.0a1 (2018-04-17). Screenshot attached.
(In reply to philipn from comment #22)
> I'm not seeing this fixed in Firefox 59.0.2 or 61.0a1 (2018-04-17).
> Screenshot attached.

Did you set the gfx.color_management.mode to 1 in about:config? By default Firefox sets it to 2, which only applies color management on images that have a profile embedded. 1 applies to everything including native CSS colors (limited to sRGB at all times)
Yeah like Hansol said you need to change the gfx.color_management.mode setting. 

Firefox should really make it default to 1. Otherwise, people are still going to be seeing the wrong colors.
Okay great, that did the trick!  I agree that it makes sense for `gfx.color_management.mode` to be set to 1 by default!
This does not work for me. Got a new 21.5 inch iMac in July 2018 (considered a late 2017 model). I have tried multiple settings. The oversaturation remains glaring -- too glaring to use in my workflow. 

Firefox 62.0.

gfx.color_management.display_profile = My iMac profile
gfx.color_management.enablev4 = true
gfx.color_management.mode = 1
gfx.color_management.rendering_intent 0
(In reply to Tlynn from comment #27)
> This does not work for me. Got a new 21.5 inch iMac in July 2018 (considered
> a late 2017 model). I have tried multiple settings. The oversaturation
> remains glaring -- too glaring to use in my workflow. 
> 
> Firefox 62.0.
> 
> gfx.color_management.display_profile = My iMac profile
> gfx.color_management.enablev4 = true
> gfx.color_management.mode = 1
> gfx.color_management.rendering_intent 0

Try blanking out the setting for gfx.color_management.display_profile. Mine is left blank and everything works for me.
Thanks CPx, that really helped a lot! I've got 100% graphics compliance now! Most of the CSS (text-based) edgy colors are fine now too. One particular CSS button is still ultra neon orangey-red (background-image: linear-gradient(#f77448, #eb5a3e) but a graphic version of it renders just fine. Previous to blanking out the setting for gfx.color_management.display_profile I was seeing the ultra-hot version of this orange text in CSS (#ff7b17). That got resolved after blanking out.
You need to log in before you can comment on or make changes to this bug.