HDR and color management in KWin
In this post I’ll talk a bit about HDR and color management, and where we are with implementing them in KWin. Before jumping into the topic though, I need to add a disclaimer: I will be simplifying a lot of things significantly, leaving others out entirely and as I am by far not a color expert, almost certainly write a few things that are wrong. If you want more credible sources and dive into the details of how all the color stuff works, I recommend you have a look at the color-and-hdr repository instead of this post.
To explain what these things mean, it’s important to take a step back and talk about how colors and brightness have traditionally been handled:
With traditional display pipelines, applications provide color data in the form of three channels, usually1 in the form of a red, a green and a blue value. These three values are in most cases sent to the display without modifications, which then applies the so-called “electro-optical transfer function” (EOTF) to the “electrical” values that are being sent through the cable, to get the desired brightness values and powers its red, green and blue LEDs (or equivalent2) accordingly. These red, green and blue light sources then emit some amount of light, the mixture of which your eyes and brain interpret as some color and brightness.