<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>506212</bug_id>
          
          <creation_ts>2025-06-26 12:50:19 +0000</creation_ts>
          <short_desc>Night Color causes green tint in HDR highlights on Wayland</short_desc>
          <delta_ts>2025-11-07 23:08:46 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Plasma</classification>
          <product>kwin</product>
          <component>colour-management</component>
          <version>6.4.1</version>
          <rep_platform>Arch Linux</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="wszqkzqk">wszqkzqk</reporter>
          <assigned_to name="KWin default assignee">kwin-bugs-null</assigned_to>
          <cc>nate</cc>
    
    <cc>xaver.hugl</cc>
          
          <cf_commitlink>https://invent.kde.org/plasma/kwin/-/commit/6acc3934dccf5b4d2618ab04cca064b3d67bd1c2</cf_commitlink>
          <cf_versionfixedin>6.5.3</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2436566</commentid>
    <comment_count>0</comment_count>
    <who name="wszqkzqk">wszqkzqk</who>
    <bug_when>2025-06-26 12:50:19 +0000</bug_when>
    <thetext>SUMMARY

Night Color causes green tint in HDR highlights on Wayland when enabled 

STEPS TO REPRODUCE
1. Activate Night Color
2. Display HDR content (such as an unresponsive window) 

OBSERVED RESULT

Bright HDR regions (specular highlights, skies) display with unnatural greenish tint
Issue disappears immediately when Night Color is disabled   

EXPECTED RESULT

Night Color temperature adjustment should not affect HDR color accuracy
HDR highlights should maintain correct color balance regardless of Night Color state   

SOFTWARE/OS VERSIONS

Linux/KDE Plasma:
KDE Plasma Version: 6.4.1
KDE Frameworks Version: 6.15.0
Qt Version: 6.9.1

ADDITIONAL INFORMATION

Reproducible: Always
GPU: AMD Radeon Vega Mobile Series [Integrated] of Ryzen R7 5800H
Display: CSO1602</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2436678</commentid>
    <comment_count>1</comment_count>
    <who name="Zamundaaa">xaver.hugl</who>
    <bug_when>2025-06-26 17:12:39 +0000</bug_when>
    <thetext>Can confirm. I haven&apos;t been able to narrow down where exactly that would happen, but afaict at some point in the pipeline we must be clipping to rgb of the actual display capabilities, instead of rgb with the white point for night light. The result is normal white, which in comparison to the rest of the display looks very green.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2467621</commentid>
    <comment_count>2</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2025-11-03 15:27:16 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/8353</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2468139</commentid>
    <comment_count>3</comment_count>
    <who name="Zamundaaa">xaver.hugl</who>
    <bug_when>2025-11-05 15:39:11 +0000</bug_when>
    <thetext>Git commit d70ee5efc9d6b856a067ed284896481cd59a91ac by Xaver Hugl.
Committed on 05/11/2025 at 14:01.
Pushed by zamundaaa into branch &apos;master&apos;.

opengl/colormanagement: also clip after tonemapping

With night light, the maximum luminance that can be represented in the buffer
without color shifts is lower than the value represented by 1.0. When writing
into the buffer, OpenGL implicitly clips for us to 1.0, so we end up with an
out of bounds value, which ends up causing color shifts when the result is
converted to a different white point.
To avoid that, explicitly clip to the maximum luminance after tonemapping.

M  +1    -0    src/core/colorpipeline.cpp
M  +5    -3    src/opengl/colormanagement.glsl

https://invent.kde.org/plasma/kwin/-/commit/d70ee5efc9d6b856a067ed284896481cd59a91ac</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2468185</commentid>
    <comment_count>4</comment_count>
    <who name="Zamundaaa">xaver.hugl</who>
    <bug_when>2025-11-05 18:22:26 +0000</bug_when>
    <thetext>Git commit 6acc3934dccf5b4d2618ab04cca064b3d67bd1c2 by Xaver Hugl.
Committed on 05/11/2025 at 17:43.
Pushed by zamundaaa into branch &apos;Plasma/6.5&apos;.

opengl/colormanagement: also clip after tonemapping

With night light, the maximum luminance that can be represented in the buffer
without color shifts is lower than the value represented by 1.0. When writing
into the buffer, OpenGL implicitly clips for us to 1.0, so we end up with an
out of bounds value, which ends up causing color shifts when the result is
converted to a different white point.
To avoid that, explicitly clip to the maximum luminance after tonemapping.


(cherry picked from commit d70ee5efc9d6b856a067ed284896481cd59a91ac)

Co-authored-by: Xaver Hugl &lt;xaver.hugl@kde.org&gt;

M  +1    -0    src/core/colorpipeline.cpp
M  +5    -3    src/opengl/colormanagement.glsl

https://invent.kde.org/plasma/kwin/-/commit/6acc3934dccf5b4d2618ab04cca064b3d67bd1c2</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>