zb3 / gnome-gamma-tool

A command-line tool that lets you change gamma in GNOME and Cinnamon (with Wayland). You can also adjust contrast and brightness. It works by creating a color profile with the VCGT table, so that changes are persistent and don't interfere with other settings like night light.
105 stars 10 forks source link

Saturation #9

Open axel9546 opened 1 year ago

axel9546 commented 1 year ago

Is it possible to adjust display saturation level?

zb3 commented 1 year ago

@axel9546 unfortunately gnome-gamma-tool can't do this because the VCGT table map is a function that takes only one parameter - the input channel value. So the resulting value of a channel (such as R, G or B) can only depend on the table and its input value.

Things like hue or saturation change can only be achieved if the ouput value for a channel can depend on all input channel values (aka 3D LUT).

axel9546 commented 1 year ago

Is there a way to do it with another software?

zb3 commented 1 year ago

@axel9546 you mean for Wayland? I'm not aware of anything like that that would work on Wayland. For xorg this may be possible with https://github.com/libvibrant/libvibrant

axel9546 commented 1 year ago

yes for wayland! It would be so much of help to know if some script would do that

zb3 commented 1 year ago

I really don't think this is possible, but I've emailed @ppaalanen, he should know much more about this.

ppaalanen commented 1 year ago

A compositor can do anything it wants to. The problem here is the interface to tell a compositor to do what you want. As this is in the domain of desktop or compositor configuration, any interface to do so is probably also desktop/compositor specific.

The real question here is, is GNOME willing to offer a programmatical interface to do what you want? Or a saturation control feature in the first place? I don't know.

@zb3, I believe that you are right that saturation control cannot be done with three 1D LUTs, it does need something more.

Once Wayland compositors implement actual color management, then it would be possible to install e.g. an display ICC profile whose effect includes saturation adjustment (without VCGT), but the problem with that is that then color managed applications (those that explicitly manage their own colors) would malfunction because of the display profile the compositor is using and also bypass the saturation adjustment. I cannot see that using a display profile in a compositor to achieve display effects will work for all applications. It may work for those applications who don't care about color.

IOW, this would be a feature request to GNOME: maybe saturation control specifically, or maybe some way to do custom display effects. It could be related to accessibility, too.

zb3 commented 1 year ago

So, currently Mutter (GNOME's compositor) doesn't provide any interface to set CTM (SetOutputCTM works only for... xorg). This means it's not currently possible to change the saturation in GNOME on Wayland without root-level hacks..

I cannot see that using a display profile in a compositor to achieve display effects will work for all applications.

Like I said in the email, if the user wants just the calibration - so that the gamma is 2.2 - then in this scenario, when the color management is properly implemented, using this tool would imply the profile was incorrect in the first place. For just adjusting the settings, yeah, using color profiles is an ugly hack :)

The real question here is, is GNOME willing to offer a programmatical interface to do what you want?

Good news here is that apparently this might one day become possible, since it'll be possible to set a custom CTM via a Mutter interface which will also work properly with the night light feature. I don't know the timeline though.

However, that will apply to mutter only. I still see color profiles as a more generic fallback hack.

axel9546 commented 1 year ago

Thanks for help? Where should I ask GNOME team for this issue?