Simple color management#9506
Conversation
|
Ready for testing. SDR -> HDR with |
|
Hi @UjinT34 , I tried to build from this branch but it crash on start up. |
|
just curious question: why are you not using lcms2 like gamescope or weston? |
No idea how to use it in our case. Might be useful for some matrix calculations but most of the work is inside shaders |
|
seems like this lib support icc, might be useful for next iteration. |
|
Is it expected for non-HDR content to be really dim when HDR is active? The colors are still correct and look like they do when cm is set to wide, but wide is a bit brighter for SDR content. When cm is set to hdr, the cursor and window borders are very bright, but everything else (except for HDR games) is dim. |
Default white brightness is only 80. Seems to be low for most cases. Will add a configurable multiplier in the future. Borders, hw cursor, blur and some other stuff doesn't have a CM atm. |
|
I replace 80 to 300 and it looks better. But I agree, configuration like |
|
Hi, I installed hyprland the other day for the first time and I've been testing this out for a bit. Seems to be a lot better than the previous Should this map SDR programs correctly to BT2020? My browser (and possibly other SDR programs (?)) still seem too saturated. At least oranges seem too red. I don't know color management and color spaces well enough to figure out what exactly the problem is. What I've gathered:
Is this just how it is supposed to work, or are the primaries not being mapped correctly? Maybe it is just the browser doing weird things (?). Though I do not really understand, how would a client outputting sRGB end up looking too saturated on a wider gamut monitor. If the colors are correctly mapped. |
|
I've tried several simple SDR brightness modifications. The image becomes brighter but I don't like the resulting quality. Probably needs a more sophisticated approach than simple multiplication. A client outputs an integer value. Maximum red in sRGB and maximum red in BT2020 will have the same value. But should look different. |
|
@9oOzv primaries conversion should work better now |
Great. I think it looks closer now. Though I do still notice some weird tint here and there compared to all my SDR monitor. Some pinks tint towards orange. Some skin tones towards green (I think... quite difficult to say actually other than it looks a bit off still). Different enough for me to believe it is not just calibration issues. Nonetheless, I think with the addition of 'sdr brightness' setting, I think this would make Hyprland much more usable on HDR monitors. |
|
iirc Plasma has values for sdr brightness and color intensity. This could (at least temporarily) take the burden of calibration away from the maintainers. Making strongly recommended defaults for calibration but letting them be configured could be an easy "out" in terms of figuring out details. But this is just my two cents, and I'm a total compositor/c++ noob |
|
I think having color intensity config for SDR would be nice at some point, as sRGB colors, even if correctly mapped, can look disappointingly unsaturated compared to wide gamut content on the same screen,. Or compared to the regular SDR monitors, that we are used to and often are much more saturated. But getting the primaries conversion correct should probably be the first step. I do not think it is correct quite yet, but I cannot tell for sure just by looking at the picture. |
|
general/total brightness is very low, even if colors are improved since the last commit (at least on my monitor) |
|
At this point I am pretty sure that conversion between primaries with the same white point is correct. No white point compensation for now. Other stuff which happens before and/or after the conversion might throw it off. Added two new monitor rules to control SDR -> HDR brightness and saturation. |
Vivid colors are oversaturated. You might have some monitor settings that compensated that oversaturation and now they cause undersaturation. |
|
I probably should have described the issue differently. Colors appear to have a yellow tint to them after that commit. For example, shades of pink tends to look like a peach color now. Btw, I check my TV's color settings, and changed the color gamut and gamma curve values and they didn't have an effect on this. |
|
Rebased on latest main with some cm proto fixes |
|
@vaxerski I guess it's time to review this, it's getting too big and not that simple |
|
sRGB colors look correct to me now. I don't see any other problems either. |
|
I think |
Should be fixed in #9600 |
|
thank you! |
|
About the sdrbrightness, would it be possible to have it in nits instead? The factor makes it confusing and dependent of the default value. |
|
Great work, I've really been looking forward to this feature. I just installed the new release and configured my monitor. Looks great, but I'm noticing an issue with the black levels. |
Adds proper color management and transformations for CM surfaces.

Describe your PR, what does it fix/add?
Added a simple CM shader and relevant settings.
New monitor rule
cm:New monitor rule
sdrbrightness: brightness multiplier for SDR -> HDR mapping (sane value 1.0 - 2.0)New monitor rule
sdrsaturation: saturation modifier for SDR -> HDR mapping (sane value 0.9 - 1.1)Removed
experimental:wide_color_gamutRemoved
experimental:hdrAdded
render:cm_fs_passthroughto disable hdr metadata changes for fullscreen apps to avoid modesetting and black screen during the switchPartially implements #9064
Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)
Desktop HDR has some weird interactions with blur and other effects.
SDR might also have incorrect interactions with blur and other effects. In general should be unnoticeable.
Old shaders are kept in place but no longer used.
New CM shader might be slow.
Some color transformations might be incorrect.
Interaction with screen capture or mirroring was not tested.
TEXTURE_EXTERNALisn't supported, probably unused.Is it ready for merging, or does it need work?
Ready for merging.