Open Bug 1903641 Opened 2 years ago Updated 1 month ago

Incorrect gamma for background color alpha when Windows ACM is enabled

Categories

(Core :: Graphics: Color Management, defect, P1)

Firefox 127
Desktop
Windows 11
defect

Tracking

()

UNCONFIRMED

People

(Reporter: me+bugzilla, Assigned: ahale)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

When Windows 11 Auto Color Management is enabled ("Automatically manage color for apps"), background colors with an alpha component (such as those specified with rgba) are displayed with an apparently incorrect gamma for the alpha component. It is especially noticeable in places like the GitHub diff view.

This occurs regardless of whether "Use legacy display ICC color management" is selected in the EXE compatibility options. It also occurs in the latest Firefox Nightly build.

This issue disappears in normal screenshots, however it does appear in OBS desktop capture (not window capture).

Attached file S2721DGF SDR ACM.icm —

Here is the ICC profile (created with MHC2Gen) that is assigned to my display

Component: General → Graphics
OS: Unspecified → Windows 11
Product: Firefox → Core
Hardware: Unspecified → Desktop

I think it is worth mentioning that this has the effect of greatly hurting the readability of some pages, such as the GitHub diff view in the screenshot.

Blocks: gfx-triage
Severity: -- → S3
Flags: needinfo?(ahale)

Ashley, will try to reproduce this.

FYI - if Windows doesn't show you the option to enable ACM, you may need to set the registry key "AutoColorManagementSupported"=dword:00000001 in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\MonitorDataStore\<MONITOR> and possibly some others: https://github.com/mydarknight/MHC2/blob/e0571fc1b82c3c771c1ad15969a0cee6e02a9565/README.md#advanced-color-for-sdr

Component: Graphics → Graphics: Color Management

Setting to P1 for investigation.

Assignee: nobody → ahale
Priority: -- → P1
No longer blocks: gfx-triage

It's plausible that rather than gamma being applied to alpha, we're working in alpha-premultiplied colors, which might intermingle things and cause it to look like it's being applied to alpha.

I'm going to try to spend some time on this bug this week. I agree with Kelsey's speculation that this is an alpha-premultiplied color, and I suspect it is on a primitive that WebRender promoted to opaque because there is nothing behind it as an optimization, so the raw color may have already been changed to be this way, possibly even in Gecko when building the display list. Ideally this needs a wrench reftest and a layout reftest (or WPT reftest, since I'd like to migrate towards using those more).

Flags: needinfo?(ahale)
Flags: needinfo?(ahale)

Hello, seems when ACM is enabled, firefox will try to limit some images(that is outside of sRGB range) to sRGB, causing it fail to display properly and making firefox basically unusable.
You can check the following websites for more information.
https://cameratico.com/tools/web-browser-color-management-test/
https://webkit.org/blog-files/color-gamut/

Also, with a chromium-based browser + "Force color profile" set to scRGB linear at chrome://flags/ (this would make those browsers display correctly when ACM is enabled), you can do a compare with it.(Be aware that screenshot won't work here)

Blocks: 1984017
Flags: needinfo?(ahale)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: