Open Bug 1832971 Opened 11 months ago Updated 7 months ago

When HDR in Windows is turned on, videos have wrong colors

Categories

(Core :: Graphics: Color Management, defect)

Firefox 114
defect

Tracking

()

UNCONFIRMED

People

(Reporter: HaitraMysh, Unassigned, NeedInfo)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

Attached image screenshots.jpg

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/114.0

Steps to reproduce:

My monitor is PG32UQX. I use it with HDR in Windows settings turned on. After updating from Firefox 114.0b1 to 114.0b3, all videos have wrong colors. I have seen the problem on all sites (YouTube and several others).

Actual results:

I don't know how to describe it but it looks like the sun is shining through the video. Colors are too bright and there are many details lost. I am attaching a file containing pictures I took with my phone camera. However, it is not as pronounced as when viewing it on the screen. The left pictures show wrong colors and the right ones show correct colors. When I take a screenshot, the colors of the video in the screenshot are correct. When I disable HDR in Windows settings or disable hardware acceleration in Firefox, the problem is gone.

I used mozregression GUI tool and found out that the problem was caused by this differential revision: https://phabricator.services.mozilla.com/D177707

Expected results:

The colors should be correct even when HDR and hardware acceleration are turned on.

The Bugbug bot thinks this bug should belong to the 'Core::WebRTC: Audio/Video' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → WebRTC: Audio/Video
Product: Firefox → Core
See Also: → 1832881
Keywords: regression
Regressed by: 1832215

Can you reproduce this on the very latest release (113.0.1)?

Flags: needinfo?(HaitraMysh)

I see the same here, with Nightly 115.0a1 (Build ID 20230513092159), on Windows 10 (22H2) and a HDR monitor (MPG321UR-QD). Chrome and Edge show videos correctly (both SDR and HDR). I know that previous Nightly versions did show videos correctly, so I will go over a few of the latest nightly builds to see which one made it regress.

Okay, Nightly Build ID 20230511213213 works correctly, 20230512094914 have "washed out" colors. Interestingly I can't take a proper screenshot of it, since Window then appears to correct the colors! If making a photo before/after is useful, let me know.

Possibly related to bug 1831820 and https://hg.mozilla.org/mozilla-central/rev/d014625bd4b6 ? (Apologies if that change hasn't got anything to do with it, but it seems like one of the few things that could be the cause, if you look at the range 20230511213213 .. 20230512094914)

https://hg.mozilla.org/mozilla-central/rev/2a3a45421336c52fdcb337accef77094b19947c6
bug 1832215
Is also a likely cause.

What happens if you flip the pref gfx.color_management.native_srgb in about:config?

(In reply to Timothy Nikkel (:tnikkel) from comment #6)

What happens if you flip the pref gfx.color_management.native_srgb in about:config?

Yes, that's it. gfx.color_management.native_srgb=false (default) -> bad video, gfx.color_management.native_srgb=true -> good video.

Only now did I see that HaitraMysh had already found that, sorry!

Version 113.0.1 (with default Firefox settings, i.e. clean profile) works correctly for me.

In version 114.0b3, it behaves the same way for me as Dimitry Andric says. When gfx.color_management.native_srgb=false colors are wrong, if it is set to true, colors are correct.

Flags: needinfo?(HaitraMysh)

:jgilbert, since you are the author of the regressor, bug 1832215, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(jgilbert)
Component: WebRTC: Audio/Video → Graphics: Color Management
Severity: -- → S3

It appears that Firefox is applying the ICC color profile, but Windows uses it already for sRGB so it is applied twice.
Usually that profile says the screen supports all BT.2020 which is not true, but that only means the screen tone maps from that to its native gamut.

So in case the screen is in HDR mode on Windows, Firefox should not apply any screen ICC profiles by default. Preferably it should use a HDR window with scRGB colorspace or BT.2020 PQ colorspace, while scaling the sRGB content appropriately with a matrix.

The same behavior should apply if SDR advanced color management is in use in Windows 11.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: