KDE: HDR and color management in KWin and upgrading Fedora KDE 40 to Fedora KDE 41 is this easy
-
HDR and color management in KWin, part 4: nonlinear blending
In Plasma 6.2, KWin switched from doing linear blending with HDR to blending in a gamma 2.2 space. Let’s take a look at what that means, and why it was done.
What is blending?
When KWin composites, it paints window by window, going by the order of how the windows are stacked - the bottom-most window first, the topmost window last. When a window is opaque, you just overwrite the pixels in the framebuffer with the ones from the window. When a window is semi-transparent though, we need to additionally do blending.
To do blending, the GPU calculates the value that the framebuffer should have with some equation that gets the pixel from the window and the existing value in the framebuffer, and outputs some appropriate value. Usually that equation is1
framebuffer = framebuffer.rgb * (1 - window.alpha) + window.rgb * window.alpha
where
window.alpha
is a per-pixel value that describes how opaque the pixel is. -
See, upgrading Fedora KDE 40 to Fedora KDE 41 is this easy!
I had an installation of Fedora 40 KDE on an external Solid State Drive (SSD) that I haven’t used in a while. With Fedora 41 out, I decided to upgrade that installation of Fedora 40 KDE to see how well the upgrade process would go.