On Wed, 30 Jun 2004 22:05:00 GMT, "Mike Russell" wrote:
Isn't the conversion between RGB and Lab lossy?
If this is a concern, work in 16 bits.
I do, and it's not really a big problem, but I was just curious.
Also, I believe you mentioned earlier that brightening up the image in RGB introduces a color shift (or words to that effect). Could you please be more specific?
Here's an example. Fill an image with RGB(10, 128, 245) Then lift the middle of the RGB curve by 10 values. The result is RGB(11, 138, 246) a color shift toward green. In HSB terms, this is a hue change of -2 degrees.
I repeated the test by first changing the color mode to Lab and that alone shifted the color to RGB equivalent of (0, 128, 245) or LAB(53, 5, -68).
After applying 10 clicks in Lightness curve at 50,50 to get 50,60 there was a color shift here as well but this time in the red. The resulting color was RGB(64, 152, 255) or LAB(62, 5, -68).
The blue seems to have been clipped so I repeated the test with RGB(64, 128, 192) and got this after applying 10 clicks in both:
(Note: The difference in magnitude is probably due to the fact that 10 out of 256 clicks in RGB is not the same as 10 out of 100 in Lab.)
in RGB: RGB(71, 138, 199)
in Lab: RGB equivalent(90, 154, 221) but due to conversion to Lab mode first, this change is from RGB(60, 129, 194) as the starting point.
So, if my math is right (it's very late!) that's a shift of RGB(+7, +10, +7) and Lab RGB equivalent (+30, +25, +27) which means there is a color shift in both cases, in this particular example with RGB favoring green while Lab favors red.
Could this be simply because of the nature of Curves? I mean they are not linear, they are, well, curves... :-) So, anything in the middle of the curve is bound to shift more than at either edge?
Don.