Luminous Landscape Forum
Raw & Post Processing, Printing => Colour Management => Topic started by: fdisilvestro on December 04, 2015, 08:26:24 pm
-
I was curious about the issue raised by forum member TRANTOR about getting different results using the same numbers in Photoshop when working in different color spaces.
http://forum.luminous-landscape.com/index.php?topic=105479.msg870588#msg870588
I'm not referring to RGB values, since it is obvious that the same numbers will lead to different results depending on the color space, but to Hue rotation. I though (and I guess TRANTOR did too) that changing Hue should lead to the same result as long as you stay inside the color space gamut.
Well, it turns out that is not the case, and Hue rotation is relative to the color space, which might affect those who work by numbers (I don't, but know some people in the graphic arts industry that do)
I started with the same color sample L=70; a=-30; b=45 and rotated the Hue all the way from -180 to +180 in three color spaces, sRGB, Adobe RGN and Lab, and plotted the resulting color in Lab coordinates.
Here are two views from a 3D plot (Y=L; X=a; Y=b. White=Lab; Green=sRGB; Red=Adobe RGB. The small yellow circle is the starting point)
(http://www.frankdisilvestro.com.au/img/s5/v124/p1614073475-4.jpg)
(http://www.frankdisilvestro.com.au/img/s11/v30/p1649798982-4.jpg)
The surprises (at least to me) are:
- The difference in the L value between RGB spaces and Lab, especially for large Hue rotations
- The shape in Lab is square (I was expecting a circle)
The following image shows the difference in the three color spaces compared with the original with a hue rotation of 45. The upper part is the original color, then from left to right sRGB, Adobe RGB and Lab.
(http://www.frankdisilvestro.com.au/img/s5/v118/p1716433145-4.jpg)
And the following with a Hue rotation of 180 (again, the upper part is the original color, then from left to right sRGB, Adobe RGB and Lab).
(http://www.frankdisilvestro.com.au/img/s2/v59/p1673780418-4.jpg)
Intrigued by the rectangular shape of the results in Lab, I calculated the DeltaE between each sample (Hue was increased in steps of 15) and got the following results:
(http://www.frankdisilvestro.com.au/img/s4/v10/p1705742732-4.jpg)
Even if the Lab shape is rectangular, the DeltaE between samples remains between 13 and 16, while in the RGB cases the variation is higher.
Is this expected? Does it makes sense to work by numbers or do you have to work in Lab for this? Or is HSL wrongly implemented in Photoshop?
-
It never occurred to me to treat HSL as absolute, precisely because it obviously relates to the color space primaries. Lab has four primaries, RGB three. In sRGB vs Adobe RGB, the green primary angle is shifted considerably between them and so a hue shift by angle is expected to differ.
-
It never occurred to me to treat HSL as absolute,...
That's my take on it as well, HSL (https://en.wikipedia.org/wiki/HSL_and_HSV#Disadvantages) is derived from RGB, so it uses what ever primaries are defined there.
As the Wikipedia article says,HSL and HSV are simple transformations of RGB which preserve symmetries in the RGB cube unrelated to human perception, such that its R, G, and B corners are equidistant from the neutral axis, and equally spaced around it.
HSL is useful for retouching and masking, but one must be careful with regard to conclusions involving human perception and colorimetry.
Cheers,
Bart
-
Also the white point is different, D50 in Lab and D65 in sRGB/ARGB. That might also affect things.
-
Also the white point is different, D50 in Lab and D65 in sRGB/ARGB. That might also affect things.
As far as I know, color spaces inside photoshop and many other applications are adapted to a common illuminant, normally D50. The following is a quote from a direct response from Bruce Lindbloom to a question I emailed him.
In most real-world applications and workflows, this is the only thing that makes practical sense. It is what ICC, Photoshop, Lightroom, etc. are based on. Although AdobeRGB is specified relative to D65, its ICC profile contains the primaries adapted from D65 to D50 using the Bradford chromatic adaptation method (use a profile inspector to examine the rXYZ, gXYZ and bXYZ tag contents). So any ICC-aware app that uses this profile is transforming colors in the D50 world, not D65. R=G=B is a D50 neutral, no matter what the native reference white of the color space.
-
The changes from a hue shift date back to the beginning of computerized color editors (computers were 3 orders of magnitude slower in computation). Initially, they used the simplest possible algorithms which did simple ratio changing regardless of the 3 illuminant cords. Since Y determines, by definition, the G channel has the most effect followed far behind by the red and blue. So when the G value stays constant (each of the RGB values take turns staying constant as the hue "angle" rotates) luminance is relatively constant but when it is varying luminance changes much more.
Lab is a different critter with 6 variables from which the L, a, and b are determined. These are X, Y, Z, and white point coordinates. Conventionally D50 is used for Lab white point so only X, Y, and Z matter. Since Y alone determines luminance, the value of Y fixes the L in Lab.
-
Not only HSL works odd.
(http://nuclearlight.net/a88.jpg)
Levels fail in Hue:
(http://s14.postimg.org/cjpk2c94d/PS_Fail_Color_Screens_01.jpg) (http://postimg.org/image/cjpk2c94d/)
Curves fail in Hue again. Really Luminosity blending? No.
(http://s2.postimg.org/8yx4qghlh/PS_Fail_Color_Screens_02.jpg) (http://postimg.org/image/8yx4qghlh/)
Selective Color fail on all of them:
(http://s9.postimg.org/esl21bknv/PS_Fail_Color_Screens_05.jpg) (http://postimg.org/image/esl21bknv/)
And so on, and so on.
-
Lab has four primaries, RGB three.
L*a*b* has three primaries - the X,Y and Z it is derived from.
-
Also the white point is different, D50 in Lab and D65 in sRGB/ARGB. That might also affect things.
L*a*b* is not D50, it is whatever the white point has been set to in the conversion. It can be D65 or anything.
It will be D50 if it is derived from an ICC profile PCS (Profile Connection Space) value, because PCS values are typically adapated to a D50 white point.
-
L*a*b* has three primaries - the X,Y and Z it is derived from.
Not in the context the question was asked - hue shift in a color wheel rotated by angle. Then it's plus/minus a and plus/minus b.
The question was functional, not technical.
-
Not in the context the question was asked - hue shift in a color wheel rotated by angle. Then it's plus/minus a and plus/minus b.
There's nothing very mysterious about the relationship between rectangular (a* b*) and polar (C*, h*) coordinates.
The mere fact that the zero's are at neutral, does not somehow turn 2 dimensions into 4!
The question was functional, not technical.
I've no idea what point you think you are making.
-
I also fail to see why Lab would have 4 primaries
-
OK, nevermind. I was just trying to answer the OP's question - which nobody else has so far.
-
I was just trying to answer the OP's question - which nobody else has so far.
It was answered by BartvanderWolf in reply #2.
-
- The shape in Lab is square (I was expecting a circle)
... me too.
Just to reverse-engineer the math:
The corners of the square are at /a/ = /b/ = the /max./ value of the initial color. From then on the Hue slider just adds or subtracts a or b, while leaving the other variable at the corner value. Quite simple, just +/- on the ab channels. No Lab->Lch transform to maintain the chroma (saturation), no consideration of dE along the hue rotation. L* is maintained - at least.
--