Bug 508791

Summary: ICC profiles applied incorrectly when compared with Windows
Product: [Plasma] kwin Reporter: erentar2002
Component: colour-managementAssignee: Zamundaaa <xaver.hugl>
Status: RESOLVED FIXED    
Severity: normal CC: nate, postix
Priority: NOR    
Version First Reported In: 6.4.4   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.5.3
Sentry Crash Report:
Attachments: zip file containing the icc color profiles in question

Description erentar2002 2025-08-27 00:47:25 UTC
Created attachment 184489 [details]
zip file containing the icc color profiles in question

SUMMARY

I want to apply the ICC profiles that came with windows on laptop, provided by the manufacturer.

The display itself supports P3.

When I enable the "sRGB" correction profile for my display on Windows, the colors become more washed out, as one would expect.

When I copy the same icm profile to linux and enable it for kwin, the colors become more saturated.

Also, the DCI-P3 profile makes the screen darker and more contrasty on windows (expected outcome) but the effect on kwin is the inverse: the display looks bleached and missing darks.

Attached are the icm profiles in question.

I have taken photos  with the same camera settings (white balance, exposure, aperture, iso) to show you what sort of a difference I am seeing. I set the screen brightness to full in each photo. I restarted firefox before each photo after changing the color profile. Windows automatic color management is disabled.

The photos are at https://drive.google.com/drive/folders/11K5Mhj3ZwJmeB-t1aVFzoCKKQqLb5cpp?usp=drive_link

Note the color shift from windows profiles to linux

SOFTWARE/OS VERSIONS
Windows: Windows 11 22601
KDE Plasma Version: 6.4.4
KDE Frameworks Version: 6.17.0
Qt Version: 6.9.1
Kernel Version: 6.15.10-200.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
Graphics Processor 1: IntelĀ® Graphics
Graphics Processor 2: NVIDIA GeForce RTX 4070 Laptop GPU
Comment 1 Zamundaaa 2025-08-28 20:37:01 UTC
I took a look at those profiles, and the result you're describing makes sense. The "sRGB" profile is very close to an actual sRGB profile, it does not actually describe the display. Same with the DCIP3 profile. Both of these are broken!

What you should use is the "native" profile, which is just a normal measurement of the display. Unlike Windows, KWin automatically takes care of the rest, no special broken ICC profiles or options are needed for that.

How these profiles are meant to work afaict is that the MHC2 tag contains a matrix + 1D LUT akin to the VCGT tag, and if you additionally apply that, it kind of works.
We'll probably have to add support for that non-standard mess, given that more people will try to use such broken manufacturer-provided profiles... or at least add detection for them and tell the user that they're broken.
Comment 2 erentar2002 2025-08-28 20:41:22 UTC
How could you tell that the "native" profile was the correct one?
Comment 3 Zamundaaa 2025-08-28 21:54:00 UTC
DisplayCAL shows it doesn't have a MHC2 tag, and it has realistic-looking primaries. That's also what I'd expect from a profile called "native".
Comment 4 Bug Janitor Service 2025-08-28 22:04:52 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/8051
Comment 5 Zamundaaa 2025-11-04 14:56:59 UTC
Git commit 816f85bb0d04f1527906d4d3ce57739675ea305e by Xaver Hugl.
Committed on 04/11/2025 at 14:28.
Pushed by zamundaaa into branch 'master'.

core/iccprofile: add support for the MHC2 tag

It's a non-standard tag Windows supports, and some Windows laptop manufacturers
use it in their profiles. While the usage of the calibration matrix seems to
be exclusively bad hacks, supporting it properly is better than the profiles
just not working at all.

M  +8    -6    src/backends/drm/drm_output.cpp
M  +110  -7    src/core/iccprofile.cpp
M  +14   -3    src/core/iccprofile.h
M  +1    -1    src/opengl/icc_shader.cpp

https://invent.kde.org/plasma/kwin/-/commit/816f85bb0d04f1527906d4d3ce57739675ea305e
Comment 6 Vlad Zahorodnii 2025-11-06 11:56:25 UTC
Git commit a3ea0d6ac46ef664e172fb652cee5b264d1eed58 by Vlad Zahorodnii, on behalf of Xaver Hugl.
Committed on 06/11/2025 at 11:10.
Pushed by zamundaaa into branch 'Plasma/6.5'.

core/iccprofile: add support for the MHC2 tag

It's a non-standard tag Windows supports, and some Windows laptop manufacturers
use it in their profiles. While the usage of the calibration matrix seems to
be exclusively bad hacks, supporting it properly is better than the profiles
just not working at all.


(cherry picked from commit 816f85bb0d04f1527906d4d3ce57739675ea305e)

Co-authored-by: Xaver Hugl <xaver.hugl@kde.org>

M  +8    -6    src/backends/drm/drm_output.cpp
M  +110  -7    src/core/iccprofile.cpp
M  +14   -3    src/core/iccprofile.h
M  +1    -1    src/opengl/icc_shader.cpp

https://invent.kde.org/plasma/kwin/-/commit/a3ea0d6ac46ef664e172fb652cee5b264d1eed58