Severe contrast enhancements: on 45% rule — and cats

Started Jun 28, 2013 | Discussions thread
Tom Axford Veteran Member • Posts: 4,558
Re: LAB mode does not preserve the colours

sjgcit wrote:

The L in LAB is not a linear mix of RGB. It's considerably more complex.

The site I generally refer to for this sort of thing is Bruce Lindbloom's website, however Wikipedia has a page on it : ( look under "Math" ).

To get the L component you need first the Y component from the XYZ space. That Y component is a linear mix of RGB. However the L component is a non-linear function of Y.

LAB is designed to give an L component that is a reasonable representation of human perceived tonality. So the L component actually makes a pretty good B&W version of an image.

However changing just L values ( leaving AB values unaltered ) and then converting back to RGB does change hue and saturation.

I find the HSV space most useful for preserving color, although no space is perfect at this in my experience. In GIMP you can mix a layer using Value mode ( the V component referred to in HSV ). This is useful for avoiding the worst of color shifts.

-- hide signature --



Thanks for your comments.

As usual, I cannot disagree with anything you say here. The formula I gave for L is a crude approximation that ignores the non-linearity.  However, the accuracy of this formula does not affect my argument, but you are correct in suggesting that I should really have mentioned that it was a  crude approximation.

I think your final statement is unduly conservative. In my (admittedly limited) experience, changing only the V values in HSV does more than just 'avoiding the worst colour shifts', it avoids all noticeable colour shifts, to my eyes at least. Are you aware of any specific examples where changing only V shows any obvious colour shifts?


Post (hide subjects) Posted by
Keyboard shortcuts:
FForum PPrevious NNext WNext unread UUpvote SSubscribe RReply QQuote BBookmark MMy threads
Color scheme? Blue / Yellow