How the saturation works ?


(lux) #1

Hello,

J’ai de la peine à comprendre comment fonctionne la saturation sur les couleurs.
Je prends deux exemples :

1/ Je créé une image monochrome de couleur : 200,128,50
En augmentant la saturation, le vert reste fixe, mais le rouge et le bleu s’écartent également du vert. sur l’histogramme.

2/ Je créé une autre image : 200,75,50
Ici, ce sont les deux couleurs vert et bleu qui s’écartent du rouge, qui lui augmente.

Comment ces déplacements de luminosité des R V B sont définis quand je modifie la saturation ?

Merci

I’ve some difficulties to understand how colors saturation works.

Two examples:

I created full colored image: 200,128,50 (RVB)
By increasing the saturation, the green remains fixed, but the red and blue deviate on the lefty and right of the green on the histogram.

I created another image: 200,75,50

here, it is the two colors green and blue that together deviate on the left of the red.

how are these brightness displacements of the R V B defined when I try to modify the saturation ?

Again, thanks for your work


#2

Salut @luxapy,

Interesting question!
Did you create the images in The Gimp?
Using which profile?

In RawTherapee, see the Colour tab.
What settings do you have for Input profile, Working profile, and Output profile?
hist
Have you set the histogram to show Working profile or Gamma-corrected output profile?

Cordialement,
Claes en Lund, La Suède


(lux) #3

Hello Claes, thanks for your answer…

Argg…:stuck_out_tongue_winking_eye:You gave me many question I can’t answer right away… but

I built a picture 1024x768 pixel uniformly colored filled with some level of RGB colors.

I loaded that picture under Rawtherapee in order to observ how the saturation intervenes in the histogramm.

It seems to me that the profile does not intervene in the histogram because I don’t compare the profiles between gimp and RT but only in RT with and without modification of the saturation …

But, may be I didn’t explain with enought accuracy what I’m searching for ?
Simply, I would like to know what is the principle or in other words, what is the Algorithm of the saturation adjustment.

I understand quite well how color works as well as saturation and desaturation on the color wheel by adding white or black, but I do not understand how it works on software, let alone by observing the histogram…


#4

Good morning, @luxapy

If you use the histogram in RawTherapee to study what happens,
you must be aware of the fact that the histogram curves depend
on either the Working profile or the Gamma corrected output profile.
You can select whichever you need.

Here is one interesting source
http://www.imagemagick.org/Usage/color_mods/#modulate

To get deep math explanations, just duckduckgo for
math rgb saturation for example.

Or https://duckduckgo.com/?q=saturation+site%3Abrucelindbloom.com&t=ffab&ia=web

Cordialement,
Claes en Lund, La Suède


(lux) #5

HI !

I found my solution on the link below.
It’s now very clear for me and, simply, we can’t have an idea of the saturation in RGB mode.
I continue some tests.
That was very interseting for me because I never though to see how works saturation.
It’s very simple to push the cursor on RT, GIMP but not to really to understand how it works.

Thanks Claes

http://www.laurenscorijn.com/articles/colormath-basics

### Saturation/Desaturation

Because of the inherent nature of the RGB model, some color operations that you might be used to from Photoshop, are not easily possible. Hue shifts and saturation adjustments for example. Hue shifts are pretty much impossible without converting RGB values to HSV (Hue Saturation Value) color model, but saturation adjustments can be done via a few calculations. This part is a bit more advanced than the previous parts, but also deserves it’s place here.

There are two methods for calculating the desaturated value of a color, something that you need to do even if you want to increase the saturation instead of decreasing it. The first method is to just average the RGB values by using the formula (R+G+B)/3, resulting in a single scalar that represents the grayscale value.

A more correct way, is to use official luminance weights when calculating the average. The reason for this is that each channel should not contribute equally to the final greyscale luminace values. The green channel generally has the least contrast, the blue channel the most (you can check this by looking at separate channels of images in Photoshop). By FCC standard, these luminance weights are determined to be RGB(0.299,0.587,0.114). Note that these values add together to 1,0 exactly. The formula when using these weights is the following: (R0.299 + G0.587 + B*0.114). You can also use a Dot product of these two vectors to obtain the exact same result (with less typing).

To increase saturation you use an alpha blending function which blends two colors together based on an alpha (blend) value. The function is the following:

Final pixel = alpha * ( color1 ) + (1.0-alpha) * (color 2)