Just saw the following on the wayland developers mailinglist HDR support in Wayland/Weston and that reminded me that I always wanted to make a topic here to discuss color management on wayland, especially since the proposal from the wayland devs itself is lacking in a few aspects, namely
- It is missing profiling/calibrating support which in contrast to what the wayland dev thinks is not an orthogonal problem (IMHO)
- Not all applications actually use ICC (anything that uses OCIO for example) so not everything can use devicelink profiles to tell the compositor what to do
- The ICC spec is rather large and complex so libraries/programs that can read devicelink profiles suddenly have a larger attack surface, this is especially a problem for compositors since those are the root of trust in the wayland world
For this and other reasons I think it would be mandatory that people from the image editing/creation software are involved in this discussion. To frame this discussion I will try to put down what I think such a protocol should look like.
There are 4 general cases here:
- Basic applications (browsers, basic viewers, video players, games, basically anything that a normal user would use to view images/videos)
- Advanced applications (image/video/3d editors, advanced viewers, so anything that needs more control over how the colors are actually rendered)
In my proposal the compositor internally should composite in linear/scene referred color space with the rec.2020 primaries, legacy/sRGB would be converted to this color space, while basic applications would render directly to this color space. Then the compositor would use a shader to render this composite down to the screen color space and in this space would composite in the advanced applications. In this case profiling can just use the advanced application route and only for the calibration we need to add a way to change the calibration LUT from the wayland protocol.
I hope this made sense since for me it is currently late in the evening so will see if I can add a diagram tomorrow.
 [RFC wayland-protocols v2 0/1] Color management protocol
 With is usually loaded into the graphics card LUT, but in advanced monitors could also be in the monitor. Theoretically this could also be a shader that would be applied at the end.