Bug 500036 - HDR + Night Light combination results in pink tinge to applications and shadows
Summary: HDR + Night Light combination results in pink tinge to applications and shadows
Status: CONFIRMED
Alias: None
Product: kwin
Classification: Plasma
Component: colour-management (show other bugs)
Version: 6.3.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2025-02-13 22:47 UTC by Rose
Modified: 2025-04-08 00:23 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
HDR and Nightlight both enabled (1.92 MB, image/jpeg)
2025-02-13 22:47 UTC, Rose
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rose 2025-02-13 22:47:38 UTC
Created attachment 178327 [details]
HDR and Nightlight both enabled

SUMMARY
Having both HDR and Night Light enabled at the same time results in parts of applications being pink tinged (others not) and the Night Light colour is not the warm orange expected, nor does it seem to be 'covering' the whole screen correctly.

STEPS TO REPRODUCE
1. Have HDR enabled
2. Turn Night Light on (or automatically scheduled on)

OBSERVED RESULT
Parts of applications and shadows look pink, the night light filter does not 'cover' the entire screen and is an incorrect shade.

EXPECTED RESULT
Night Light should look (mostly) the same whether HDR is on or off.

SOFTWARE/OS VERSIONS
Operating System: CachyOS Linux (Arch based)
KDE Plasma Version: 6.3.0
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.2
Kernel Version: 6.13.2-2-cachyos (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 5600X 6-Core Processor
Memory: 33.6 GB of RAM
Graphics Processor: AMD Radeon RX 6800 XT
Manufacturer: ASUS

ADDITIONAL INFORMATION
This seems to have only started after updating to Plasma 6.3.
- See attached image for what it looks like with both HDR and the Night Light enabled (observed result).
- HDR on but Night Light off: https://i.postimg.cc/xd3m8798/HDR-on-Nightlight-Off.jpg
- HDR off and Night Light on: https://i.postimg.cc/QxgTxChs/HDR-off-Nightlight-on.jpg

Supplied photos are using a phone camera since screenshots do not show the issue.
Comment 1 Bug Janitor Service 2025-02-14 16:05:23 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/7157
Comment 2 Zamundaaa 2025-02-14 16:08:36 UTC
There was a regression for night light, but it was that it was applied too strongly without HDR or a color profile. The linked MR will fix that.

I measured the color temperature on my screen, and we're about the same distance from 4000K when night light is set to that as my screen is away from 6500K without night light.

The reason why some parts of the image look different from the rest seems to just be that they're not actually neutral gray. If you check the Breeze colors with a color picker, the white parts of the window are 0xFFFFFF and the gray parts are 0xEFEFF0 - the missing blue becomes extra visible with night light. I'm not sure there's anything we can really do about that, except perhaps change Breeze to use neutral grays.
Comment 3 Zamundaaa 2025-02-14 17:07:56 UTC
Git commit c523fce6c1792969fca36575a2ace43c75f69b8a by Xaver Hugl.
Committed on 14/02/2025 at 16:55.
Pushed by zamundaaa into branch 'master'.

backends/drm: fix fallback pipeline for night light

I forgot to apply the transfer function to the factors

M  +1    -1    src/backends/drm/drm_output.cpp

https://invent.kde.org/plasma/kwin/-/commit/c523fce6c1792969fca36575a2ace43c75f69b8a
Comment 4 Zamundaaa 2025-02-14 17:36:49 UTC
Git commit 634ddbf007f48d25d45c9b52cbf90497c5b2a5c5 by Xaver Hugl.
Committed on 14/02/2025 at 17:15.
Pushed by zamundaaa into branch 'Plasma/6.3'.

backends/drm: fix fallback pipeline for night light

I forgot to apply the transfer function to the factors
(cherry picked from commit c523fce6c1792969fca36575a2ace43c75f69b8a)

M  +1    -1    src/backends/drm/drm_output.cpp

https://invent.kde.org/plasma/kwin/-/commit/634ddbf007f48d25d45c9b52cbf90497c5b2a5c5
Comment 5 Real Name Here 2025-02-16 19:10:56 UTC
I experience this in HDR and SDR while using an ICC profile.  The warmer, I set night light the pinker everything becomes.
Comment 6 Rose 2025-02-16 20:30:13 UTC
(In reply to Real Name Here from comment #5)
> I experience this in HDR and SDR while using an ICC profile.  The warmer, I
> set night light the pinker everything becomes.

I just tested this out on a monitor that uses an ICC profile but isn't HDR enabled, and can confirm I get the same behaviour.

My usual monitor (that I based this report on and took screenshots) uses a built-in ICC profile (moot when using HDR as that the ICC setting gets disabled when enabling HDR) so I had assumed it was an issue with the combination of Night Light + HDR rather than Night Light + ICC.
Comment 7 Rose 2025-02-17 21:04:48 UTC
I updated my system, this morning, to KDE frameworks 6.11 and this issue has resolved for me.
Comment 8 Bug Janitor Service 2025-02-18 00:54:36 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/7177
Comment 9 Zamundaaa 2025-02-18 01:00:06 UTC
The MR should help, though on my display it still looks a bit of a different than in SDR with the built-in color profile. I *think* that's just because the display has an odd white point; please check if it looks right for you.
Comment 10 Zamundaaa 2025-02-18 01:57:09 UTC
Git commit 10c04995c1f9f82ddbd6610e5e007efe9d8af13b by Xaver Hugl.
Committed on 18/02/2025 at 01:46.
Pushed by zamundaaa into branch 'master'.

backends/drm: never increase brightness for night light

In many cases, the adapted factors have all channels below 1.0. With the previous code,
this meant brightness was getting increased to compensate for that, which could cause
colors to be clipped during rendering.

M  +1    -1    src/backends/drm/drm_output.cpp

https://invent.kde.org/plasma/kwin/-/commit/10c04995c1f9f82ddbd6610e5e007efe9d8af13b
Comment 11 Bug Janitor Service 2025-02-18 02:12:02 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/7178
Comment 12 Zamundaaa 2025-02-18 02:25:22 UTC
Git commit a4031e92ca630e76752f4f3871928f45c1c42bec by Xaver Hugl.
Committed on 18/02/2025 at 02:11.
Pushed by zamundaaa into branch 'Plasma/6.3'.

backends/drm: never increase brightness for night light

In many cases, the adapted factors have all channels below 1.0. With the previous code,
this meant brightness was getting increased to compensate for that, which could cause
colors to be clipped during rendering.


(cherry picked from commit 10c04995c1f9f82ddbd6610e5e007efe9d8af13b)

Co-authored-by: Xaver Hugl <xaver.hugl@gmail.com>

M  +1    -1    src/backends/drm/drm_output.cpp

https://invent.kde.org/plasma/kwin/-/commit/a4031e92ca630e76752f4f3871928f45c1c42bec
Comment 13 Zamundaaa 2025-02-18 15:22:18 UTC
6.3.1 is out with that change included; please re-test!
Comment 14 Rose 2025-02-18 22:42:46 UTC
(In reply to Rose from comment #7)
> I updated my system, this morning, to KDE frameworks 6.11 and this issue has
> resolved for me.

In case this info is still useful, I still encounter this bug if my system goes to sleep - once woken up, I again experience the pink tinged applications instead of the correct night light orange. This only happens waking from sleep though.
Comment 15 Rose 2025-02-18 23:09:13 UTC
(In reply to Zamundaaa from comment #13)
> 6.3.1 is out with that change included; please re-test!
Just updated to 6.3.1. Turned Night Light to always on. All seemed well - it looked correct. Slept my PC and upon waking, again, all looked fine. However, when I set it back to my usual "Switching Times: Custom times", I'm again getting the weird pink tinge. It's no where near as obvious pink tinge as it was originally but it is still there.
If I switch from "Custom times" to "Always on night light", I again get the correct orange. If I switch back to "Custom times", it goes back to the slight pink tinged parts of apps.
I've tried taking a photo but it's difficult to show as my camera is not really picking up the pink tinge very well: https://i.postimg.cc/R0hX1B7t/IMG-20250219-115229-426.jpg
It's again, still only affecting non-white areas of the screen and white areas of the screen remain completely unfiltered and look normal white. With "Always on night light", white parts of apps have the orange filter applied appropriately.
Comment 16 Rose 2025-02-18 23:20:16 UTC
Ok, I tried something else and I realise it's not anything to do with "Always on..." vs "Custom times" - it's the colour temperature setting. For my usual day time use, I use 5,700-6,000 kelvins and my night time use is around 3,500-4,000 kelvins - if I use the slider, the closer I get to the day time colour temp, the less orange filter I get, the more the non-white areas start appearing pink and the white areas look plain white. This is noticeable to my vision at around 4,800 kelvins (and higher until about 6,300k at which point it just looks like the night light is off).
Comment 17 Zamundaaa 2025-02-19 14:49:58 UTC
Okay, that sounds similar to what I saw. I'm not sure where it could come from, but let's keep this open until it's fully solved.
Comment 18 Real Name Here 2025-02-24 20:20:10 UTC
(In reply to Zamundaaa from comment #17)
> Okay, that sounds similar to what I saw. I'm not sure where it could come
> from, but let's keep this open until it's fully solved.

Are there any ways for us to possibly help in troubleshooting this?  And would you happen to know of a method to set/unset an ICC profile via command line so I am able to automate disabling my ICC profile when Night Light kicks in? Kscreen-doctor doesn't seem to have this option.

Thanks for all of your color work in Plasma, by the way!
Comment 19 Some Reporter 2025-03-01 22:23:22 UTC
Having this issue on Fedora 41, Plasma 6.3.2. Thinkpad T480 (Intel UHD620), no ICC, no HDR.

It's just the night color makes everything look odd, especially the dark areas are pink and clumped together, the rest is more washed out, even on stuff like web sites. It's like the gamma is way too aggressive. This may be also because my laptop screen is crap, but I didn't have this problem before the last update. Night light is set to 3200K at night (right now, it's worse) and 5000K at day.

Also #500837 and #499103 related, because it's worse in 3D full-screen apps.
Comment 20 Zamundaaa 2025-03-05 16:01:28 UTC
(In reply to Real Name Here from comment #18)
> Are there any ways for us to possibly help in troubleshooting this? 
I don't really have any leads right now. You could attach the ICC profile you see the problem with here though, when I find something it would be good to have an easier way to test it.

> And would you happen to know of a method to set/unset an ICC profile via command
> line so I am able to automate disabling my ICC profile when Night Light
> kicks in? Kscreen-doctor doesn't seem to have this option.
You can set the color profile mode with kscreen-doctor output.1.colorProfileSource.sRGB / ICC / EDID, or the ICC profile itself with screen-doctor output.1.iccprofile."/path/to/profile" (empty string for unsetting it)
Comment 21 Bug Janitor Service 2025-04-08 00:23:25 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/7459