If I decompose into RGB it is obvious that the grayscale level represents for example ‘amount of red’ for the red layer. It is semi-obvious for HSL that the grayscale level for the ‘H’ layer represents ‘degrees of hue’ for the Hue layer.
What I am not clear about are the de-compositions for YCbCr. I do think that the ‘Y’ layer represents relative luminance i.e. 0-255=0-1 for the Rec. 709 version.
It is common in the literature to scale e.g. Cb as -1 to +1. Does grayscale 0-255 in the GIMP ‘Cb’ layer represent -1 to +1 or does it represent some other scaling?
Are all the GIMP’s decomposition layer representations or scalings listed anywhere? (I am not a programmer).
That’s a good question. Gimp has two pairs of versions of the YCbCr decomposition, and one of each pair is labelled 256. Coincidentally, the Wikipedia page on YCbCr states that
For example, the scaling and offset applied to the Y′ component per specification (e.g. MPEG-2[2]) results in the value of 16 for black and the value of 235 for white when using an 8-bit representation. The standard has 8-bit digitized versions of CB and CR scaled to a different range of 16 to 240
So one could imagine that the 256-less version has the official scale and the 256 one uses the full scale of 256 values, but in practice I don’t see any difference between the two…
Thanks for the link. I also read the Wiki more fully and made a spreadsheet from:
Digital Y′CbCr (8 bits per sample) is derived from analog R’G’B’ as follows:
Y ′ = 16 + ( 65.481 ⋅ R ′ + 128.553 ⋅ G ′ + 24.966 ⋅ B ′ )
C B = 128 + ( − 37.797 ⋅ R ′ − 74.203 ⋅ G ′ + 112.0 ⋅ B ′ ) C R = 128 + ( 112.0 ⋅ R ′ − 93.786 ⋅ G ′ − 18.214 ⋅ B ′ )
So from that one could deduce that, with zero R’G’B’ the grayscale values of the R.709 255 should be 16,128,128.
Then I went to the R.709 website and entered their formula into my spreadsheet.
The BT.709 standard defines an alternative representation of colors by three coordinates ( E Y ′ , E C B ′ , E C R ′ )
E Y ′ = 0.2126 E R ′ + 0.7152 E G ′ + 0.0722 E B ′
E C B ′ = E B ′ − E Y ′ / 1.8556
E C R ′ = E R ′ − E Y ′ / 1.5748
The value E Y ′ is called “luminance” in the standard, and is roughly an approximation of the CIE Y coordinate (which is presumed to measure the perceptual brightness of the color) modified by the non-linear function above. However, since E Y ′ is computed from the non-linear RGB components, this equivalence is correct only for shades of gray. The other two coordinates indicate the “blueness” and “redness” of the color’s hue.
According to these formulas, as E R ′, E G ′ , and E B ′ vary between 0 and 1, the luminance E Y ′ will vary between 0 and 1, while E C B ′ will vary between − 0.5 and + 0.5
In the GIMP it looks like:
Y’ is scaled as expected 0-255 grayscale = 0 to 1
Cb and Cr are 0-255 grayscale = -1 to 1, meaning that 127 grayscale = 0
the which lines up with the below if Y’ = 0.5: