Severe contrast enhancements: on 45% rule — and cats

Started Jun 28, 2013 | Discussions thread
knickerhawk Veteran Member • Posts: 5,922
Re: LAB mode does not preserve the colours

Tom Axford wrote:

knickerhawk wrote:

It seems like kind of an odd argument that adjusting L in LAB "does not preserve the colors". By definition it does. The problem comes when one has to return to the limitations imposed by the color space you're outputting to. However, as long as you stay within the gamut of your output color space, L adjustments should be as color neutral as you could hope for. Certainly as neutral as anything you're going to be able to do in an RGB space.

Unfortunately, there is a fly in the ointment.

Unfortunately, the same fly is in your ointment too.

Perhaps the best way to see the problem is through an example. Take the following image, which is a bright red in which the R channel is at the maximum (255):

Convert this image to LAB mode and then change the L component to maximum everywhere (i.e. make the L layer a pure white layer) and convert back to RGB. The result is (according to GIMP):

It has clearly changed colour. Why?

The problem is that the luminosity of the original colour is well below the maximum luminosity, but when you try to raise its luminosity, the red channel inevitably gets clipped (because the red channel is already at the maximum possible), causing the colour shift.

I already acknowledged this issue. LAB is particularly "dangerous" in the sense that you're working with a much bigger color space than most RGB color spaces.  The problem of channel clipping, though, is certainly not unique to LAB, so it's rather unfair to use this example as some kind of "proof" that there is a problem with working with LAB to adjust contrast.  If I take your red sample above and do a brightness push in RGB, guess what?  It turns yellowish ochre just like it did in LAB.

Again, contrast adjustments made in the L channel are as neutral with respect to color shifts as you could hope for.  I've seen it time and time again.  When I boost contrast in RGB, I get subtle unwanted shifts in hue and often more saturation than is desired.  Blue sky shifts to red.  Grass  turns lime green.  Often, I can minimize the unwanted impact by doing a luminosity blend in RGB.  However, the same effect as a luminosity blend is achieved in LAB by adjusting the L channel.  Depending on the image, LAB is often the best solution for making these kinds of adjustments.

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