Can Photoshop lighten an image while preserving hue and saturation?

Tom Axford

Forum Pro
Messages
11,599
Solutions
57
Reaction score
13,499
Location
Midlands, UK
For over ten years I have been using GIMP in preference to Photoshop because GIMP allows me to lighten images while guaranteeing that the colours remain precisely as they are; i.e. hue and saturation remain unchanged.

When I lasted looked at PS, there was no way of doing this (as far as I could ascertain). I haven't looked closely at PS for several years and I was wondering if any recent enhancements to PS now make this possible.

Does anyone here know if the latest version of PS has this capability?

In GIMP, I use the HSV colour model for this purpose. Does anyone know if PS supports any aspects of the HSV colour model?
 
Solution
Hi Tom

Yes it can be done a couple ways (and there are probably more) yet not directly in blend modes (pretty sure).

The equations for Hue between PS and Gimp are the same yet in the Layer Blend modes PS uses different equations for Saturation (they don't mean the same thing) and Gimp uses value/brightness of the HSB model and PS uses Luminosity = .3R+.59G+.11B

Note that PS is not consistent because in the color picker they do have the traditional use of HSB so go figure.

PS has quite a few capabilities to simulate most any equation combination of RGB so here are the two approaches off hand

1)

a) duplicate your image to a new Layer

b) Apply the Filter > Other > HSB/HSL and use the options to convert from RGB to HSB

c) Select the...
Of course, the crux of the problem is that the gamut of a colour space using luminosity or some similar measure of brightness is far larger than the RGB colour space. Hence, it is easy to generate colours which cannot be represented in RGB and those colours often get seriously distorted when converting back to RGB.

For example the blue colour R=10%, G=20%, B=80% has a luminosity of 24% or thereabouts. In playing around with the image brightness it is easy to double the luminosity to 48% (while preserving hue and saturation), which is well within the gamut of the colour space being used.

However, conversion back to RGB gives R=20%, G=40%, B=160%, which is not valid because B exceeds 100%. If R=20%, G=40%, B=100% is used, that does not preserve hue and saturation.

When using colour spaces like Lab colour that are based on luminosity, this problem is always going to exist when converting back to RGB. Yet I don't hear people discussing it when talking about using Lab colour. Why?
Hi Tom
You touched on a wide range of topics in your last post from color spaces, to color modes, percentages of components and in some cases absolute numbers from 0-255 for RGB numbers come in to play. Depending on which color mode one is using and depending on the software used, certain color mode components can be preserved while other components may not be.

I use Photoshop and not familiar with the specifics of GIMP so may not be able to help/comment.

Hard to have a discussion on all of the above at once and usually easier to address specific topics with examples. Good topic yet given it is pretty much a separate topic that what you original post was about, it might be better with more forum attention if you start another thread with specific examples and thoughts/questions. just a suggestion.
 
I was really just musing aloud -- and not entirely expecting an answer.

As you suggest, I'm not sure exactly what question to ask!

Thanks for your comments.

Tom.
 
So according to you guys the HS or ab component defines the color.... Would I be correct if I said that if you strip out the Lightness/Value/Brightnes component (regardless of the colorspace), and you would desaturate the remaining image, you would be left with a 50% gray filled image?

And another tought: a colorspace can be practical (like CMYK and RGB) and targeted to a specific input/output device that can put out a range of colours in a certain way. Other colourspaces like L*ab, HSV, HSB and so on are more theoretical, and can describe a colour that can not be reproduced physically. Like a completely dark bright yellow. The HS component states it's yellow, but the Lightness or Value component at 0% states that it will not emit that colour.

So whenever you are talking about 'translation', you will also need a way to get around that fact. to get from the theoretical to the practical.

Keep in mind that we are always talking about images that are captured using RGB methods. every conversion to a more theoretical colorspace will give you gaps in your information, and every conversion back to RGB will lose information. And as you are using a monitor, that conversion is always taking place as soon as you view the picture. Any discussion about 'correctness' of colour representation is rendered purely academical at that point.

So, as handy as those colourspaces can be for targeted editing of colours, I am also wondering: In what real-life, practical scenario, would you truely notice a difference, and get into trouble using RGB instead of HSV/HSB/Lab?
 
However, conversion back to RGB gives R=20%, G=40%, B=160%
How do you convert to RGB?
Well, there are mathematical formulae for getting H, S and L from R, G and B; and more formulae for getting R, G and B from H, S and L. I don't know those formulae offhand, and I didn't attempt to use them.

Instead, I simply made use of the knowledge that if I double the luminosity of the colour R=10%, G=20% and B=80%, that simply means that the R, G and B channels are all doubled. The problem is, of course, that R, G and B are all limited to 100%. Any value above that has to be clipped to 100%.

On conversion between the different colour models, I am very lazy about doing the maths myself so I usually just use the colour picker or other tools in my photo editor which give the numerical values of RGB, HSV, LAB, etc. for the chosen colour.
 
So according to you guys the HS or ab component defines the color.... Would I be correct if I said that if you strip out the Lightness/Value/Brightnes component (regardless of the colorspace), and you would desaturate the remaining image, you would be left with a 50% gray filled image?
If you set Lightness/Value/Brightness to zero, the image would be all black. If you set L/V/B to 100% everywhere, then you will get different results for the different colour models.
And another tought: a colorspace can be practical (like CMYK and RGB) and targeted to a specific input/output device that can put out a range of colours in a certain way. Other colourspaces like L*ab, HSV, HSB and so on are more theoretical, and can describe a colour that can not be reproduced physically. Like a completely dark bright yellow. The HS component states it's yellow, but the Lightness or Value component at 0% states that it will not emit that colour.
It will be pure black if L/V/B is zero.
So whenever you are talking about 'translation', you will also need a way to get around that fact. to get from the theoretical to the practical.

Keep in mind that we are always talking about images that are captured using RGB methods. every conversion to a more theoretical colorspace will give you gaps in your information, and every conversion back to RGB will lose information. And as you are using a monitor, that conversion is always taking place as soon as you view the picture. Any discussion about 'correctness' of colour representation is rendered purely academical at that point.

So, as handy as those colourspaces can be for targeted editing of colours, I am also wondering: In what real-life, practical scenario, would you truely notice a difference, and get into trouble using RGB instead of HSV/HSB/Lab?
It entirely depends on what you want to do and what the image is.

I don't have time just now, but I'll try to give an example later.
 
However, conversion back to RGB gives R=20%, G=40%, B=160%
How do you convert to RGB?
Well, there are mathematical formulae for getting H, S and L from R, G and B; and more formulae for getting R, G and B from H, S and L. I don't know those formulae offhand, and I didn't attempt to use them.

Instead, I simply made use of the knowledge that if I double the luminosity of the colour R=10%, G=20% and B=80%, that simply means that the R, G and B channels are all doubled. The problem is, of course, that R, G and B are all limited to 100%. Any value above that has to be clipped to 100%.

On conversion between the different colour models, I am very lazy about doing the maths myself so I usually just use the colour picker or other tools in my photo editor which give the numerical values of RGB, HSV, LAB, etc. for the chosen colour.
Just wondering if you're familair with the Photoshop plug-in, Curvemeister, which gives you access, in addition to RGB, to channels and masks in LAB, HSB, and CMYK, and does all the recalcuations back to RGB when you apply the changes and reenter Photoshop. I find it to be indispensible.

https://curvemeister.com/
 
So according to you guys the HS or ab component defines the color.... Would I be correct if I said that if you strip out the Lightness/Value/Brightnes component (regardless of the colorspace), and you would desaturate the remaining image, you would be left with a 50% gray filled image?
If you set Lightness/Value/Brightness to zero, the image would be all black. If you set L/V/B to 100% everywhere, then you will get different results for the different colour models.
Nah, I meant completely strip the info, for instance by turning off the channel it is on. Then you should be left with only color information.

I did some searching, and I see now that HSV doesn't have a single channel that does that. The Hue channel is only the color temperature, but the lightness is a combination of the S and V components.

https://commons.wikimedia.org/wiki/File:Hsl-hsv_models.svg

That kind of takes away the advantage that it has over RGB, that is that the colour and lightness info are truly split and independent.
 
Last edited:
It will be pure black if L/V/B is zero.
Define what you mean by 'it IS black'... Your monitor would display it as RGB black, your eyes would percieve it as black, but according to your colour model it would be a yellow hue with 100% saturation. Only no Lightness.

That's also the problem with converson. in the theoretical spaces, you've got a black plane, with 100x100=10.000 shades of black. If you convert that to RGB, all those points converge to one point, R:0, G:0 and B:0. The color information is thereby lost.

If L*ab colourmodel for example is a cube with edges L, a and b, for all posible combinations, real or imaginairy, the RGB colourmodel is a banana shaped volume in that cube, with pointy extremities at white and black. it can only represent visible, reproduceable colours.
 
Last edited:
Just wondering if you're familair with the Photoshop plug-in, Curvemeister, which gives you access, in addition to RGB, to channels and masks in LAB, HSB, and CMYK, and does all the recalcuations back to RGB when you apply the changes and reenter Photoshop. I find it to be indispensible.

https://curvemeister.com/
Yes, I am, used it for a while, it does what it says, but didn't find it pratical enough. The moments I want to do edits in a different colourmodel, I switch to that model, no problem. And in your PS histogram and info-bar you can get the colourvalues on the fly for the supported models.

For some operations I wrote that into macro-actions.

It's just for such specific use cases that I don't feel like I need a separate plug-in for it.
 
So according to you guys the HS or ab component defines the color.... Would I be correct if I said that if you strip out the Lightness/Value/Brightnes component (regardless of the colorspace), and you would desaturate the remaining image, you would be left with a 50% gray filled image?
If you set Lightness/Value/Brightness to zero, the image would be all black. If you set L/V/B to 100% everywhere, then you will get different results for the different colour models.
Nah, I meant completely strip the info, for instance by turning off the channel it is on.
You cannot do that, it is meaningless. If you have only hue and saturation, you cannot reconstitute the RGB values. You must assume some value for V or L.
Then you should be left with only color information.

I did some searching, and I see now that HSV doesn't have a single channel that does that. The Hue channel is only the color temperature, but the lightness is a combination of the S and V components.

https://commons.wikimedia.org/wiki/File:Hsl-hsv_models.svg

That kind of takes away the advantage that it has over RGB, that is that the colour and lightness info are truly split and independent.
If you read the Wikipedia article, it explains the relationship between HSL, HSV and RGB. You can see from the colour diagrams you gave a link to, that all colours become black along the bottom of the chart (L=0 or V=0).
 
It will be pure black if L/V/B is zero.
Define what you mean by 'it IS black'... Your monitor would display it as RGB black, your eyes would percieve it as black, but according to your colour model it would be a yellow hue with 100% saturation. Only no Lightness.

That's also the problem with converson. in the theoretical spaces, you've got a black plane, with 100x100=10.000 shades of black. If you convert that to RGB, all those points converge to one point, R:0, G:0 and B:0. The color information is thereby lost.

If L*ab colourmodel for example is a cube with edges L, a and b, the RGB colourmodel is a banana shaped volume in that cube, with pointy extremities at white and black. it can only represent visible, reproducable colours
You have misunderstood the mathematics.

In the HSL model, any point with L=0 is black and any point with L=100% is white.

So H=0, S=0, L=0 is black, but so is H=360degrees, S=100%, L=0. In fact, there are an infinite number of points in HSL colour space that represent black. That introduces an ambiguity about how to represent black, but it is a mathematical ambiguity, not a real one.

It does not compromise the use of HSL, because exactly the same ambiguity occurs with photography. If you accidently grossly underexpose an image, it comes out black. You have no way of telling what colour it will be if you take the same shot with the right exposure.

Just as when you are in a room with the lights out, it just looks black. You cannot tell what colour the walls are until you turn the lights on.

Every colour looks black when you turn the lights out!
 
Every colour looks black when you turn the lights out!
Exactly. but the objects in that room are not black. And your computer knows that, even if for you as a viewer the lights are 'out'.

RGB is intuitive for us, because it is also how our eyes work. But a computer has no eyes, and it knows more about a pixel than you see. If you start altering the picture, fe by upping the lightness, the computer wil take this 'hidden data' into account.

For example, using the L*ab model, I made four squares, all yellow, but having a Lightness value from 0 on the left to 100 on the right. Reading the RGB value for the left one, I get 0,0,0 (ofcourse). Now I throw on a curves adjustment, raise the Lightness, and you see the square that you with your RGB eyes thought was 'black' getting some colour again.

So not all blacks are equal, even if the lights are out.

cc937e3d00d54d8dacd850a04bcd7eff.jpg

And that's the beauty of L*ab colourspace, if you feed it the right information, you can get really wild with edits. It decouples colour from Lightness. Even if you, by editing, 'turn out the lights' or crank up the Lightness, the colour information is still there. And when you alter the colours, the Lightness doesn't change.

For now, I really don't see what advantage HSV has over L*ab, and where I would need that.
 
Last edited:
In the HSL model, any point with L=0 is black and any point with L=100% is white.
Nope. You percieve every point as black, or white, And conversion to RGB would truely render that point to an RGB black or white.

Maybe Dan Margulis's books on L*ab are a nice read for you.
 
Every colour looks black when you turn the lights out!
Exactly. but the objects in that room are not black. And your computer knows that, even if for you as a viewer the lights are 'out'.

RGB is intuitive for us, because it is also how our eyes work. But a computer has no eyes, and it knows more about a pixel than you see. If you start altering the picture, fe by upping the lightness, the computer wil take this 'hidden data' into account.

For example, using the L*ab model, I made four squares, all yellow, but having a Lightness value from 0 on the left to 100 on the right. Reading the RGB value for the left one, I get 0,0,0 (ofcourse). Now I throw on a curves adjustment, raise the Lightness, and you see the square that you with your RGB eyes thought was 'black' getting some colour again.

So not all blacks are equal, even if the lights are out.

cc937e3d00d54d8dacd850a04bcd7eff.jpg

And that's the beauty of L*ab colourspace, if you feed it the right information, you can get really wild with edits. It decouples colour from Lightness. Even if you, by editing, 'turn out the lights' or crank up the Lightness, the colour information is still there. And when you alter the colours, the Lightness doesn't change.

For now, I really don't see what advantage HSV has over L*ab, and where I would need that.
It may not have any advantage for you, it depends what you want to do.

However, if you want to "crank up the lightness", really crank it up, then HSV will preserve colour long after Lab has given up.

Here is an example:



Original image
Original image



Image with Luminance set to 100% everywhere. The colours are nearly all wrong, both washed out and changed in hue.
Image with Luminance set to 100% everywhere. The colours are nearly all wrong, both washed out and changed in hue.



Image with Value set to 100% everywhere.  The colours remain the same as in the original, only the lightness/brightness has been changed.
Image with Value set to 100% everywhere. The colours remain the same as in the original, only the lightness/brightness has been changed.

This is a very extreme case, but it shows what happens using GIMP. I don't know if the result will be exactly the same using other implementations of Lab colour, but I expect they will be similar. Perhaps you can try it.

 
However, conversion back to RGB gives R=20%, G=40%, B=160%, which is not valid because B exceeds 100%
RGB values are no percentages. but values between 0 and 255... So 160 is a valid value. your R:20 G:40 B:160 would be a lighter blue that is the closest approximation you can get in the RGB colour model with the RGB colourspace that you used.
 
In the HSL model, any point with L=0 is black and any point with L=100% is white.
Nope. You percieve every point as black, or white, And conversion to RGB would truely render that point to an RGB black or white.
You are attributing a sort of "truth" to the mathematics which doesn't exist. The reality is true, the mathematics just represents reality, it does not supersede it.
Maybe Dan Margulis's books on L*ab are a nice read for you.
 
However, conversion back to RGB gives R=20%, G=40%, B=160%, which is not valid because B exceeds 100%
RGB values are no percentages. but values between 0 and 255... So 160 is a valid value. your R:20 G:40 B:160 would be a lighter blue that is the closest approximation you can get in the RGB colour model with the RGB colourspace that you used.
They are often expressed either as percentages or on a scale 0 to 1.
 
It may not have any advantage for you, it depends what you want to do.
Exactly my point. what and why? Without getting academical.
However, if you want to "crank up the lightness", really crank it up, then HSV will preserve colour long after Lab has given up.
This is a very extreme case, but it shows what happens using GIMP. I don't know if the result will be exactly the same using other implementations of Lab colour, but I expect they will be similar. Perhaps you can try it.
I know what it does, but why would you want to do this again? How is this in any way going to help you process pictures to something usefull?
 

Keyboard shortcuts

Back
Top