Open Bug 1832971 Opened 2 years ago Updated 25 days ago

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

Categories

(Core :: Graphics: Color Management, defect)

Firefox 114
defect

Tracking

()

People

(Reporter: HaitraMysh, Unassigned, NeedInfo)

References

(Blocks 1 open bug, 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.

I cannot reproduce this in the latest Nightly 137.0 on Windows 11 24H2 with an Nvidia GPU. I have also tried installing a deliberately incorrect color profile in Windows (Both as regular SDR and "Advanced color"/HDR profiles) to try and induce the bug, but video colors still look correct and identical to Chromium browsers in Windows' HDR mode.

gfx.color_management.native_srgb doesn't seem to change anything for this bug any more as far as I've tested. No video color issues with either the default false value as well as true.

It's possible this bug was fixed at some point in the past two years due to a change elsewhere. Can anyone else with an HDR display confirm?

It's still there, though sometimes hidden on nVidia due to RTX Video option which bypasses Firefox color management.

Additionally, Firefox does not load ICC profiles with negative values for color coordinates. So the non-compat BT.2020 profile will do nothing and Firefox falls back to no mapping. Compat BT.2020, Display-P3 or DCI-P3 still does though, as well as some monitor profiles.

This on Windows 10. Will have to check latest version of Windows 11 24H2, it might no longer be reporting the ICC profile via legacy API when HDR is on, so no profile is applied, or might be reporting sRGB profile according to the color management option in settings finally.
Or Microsoft has toggled the compatibility flag due to bug reports.

That is still not good enough, since for correct tone mapping and display the correct color space is required.

Hi, I just made an account purely for this bug as it has been annoying me for a while and i see this is still unconfirmed
I am using Firefox 137.0.2 on Windows 11 23H2

As you can see in these picture of sdr video (which i had to take as taking a screenshot with any other program will make it look normal)

https://imgur.com/a/hdr-on-off-comparison-firefox-6d7szD9
With HDR enabled, everything becomes a bit washed out along with, more obviously, in the game where the blocks are meant to be dark as they are underground, are very visible and more or less succumbs to youtube's compression.
With it disabled, the video looks as should, given its a sdr video.

gfx.color_management.native_srgb set to true or false appears to have no effect
RTX HDR video enhancement is disabled for the screenshots

On chrome, as others have said the video looks completely fine regardless of hdr being enabled or not.

I hope this bug gets fixed as the lack of HDR support in windows is quite literally the only reason i have other chromium based browsers installed.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(jgilbert) → needinfo?(ahale)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: