Reducing Contrast Without the Colours Fading (using GIMP)
Suppose we wish to reduce the contrast of a colour image by using any of the normal tools to do this (such as Brightness-Contrast, Levels or Curves). The more we reduce the contrast, the more the colours look faded or washed out (the colour saturation has been reduced). It is rarely possible to compensate simply by increasing the colour saturation because different colours can be affected to different amounts and the hue of some colours may have changed also. This is an unfortunate consequence of the RGB model used by all the common post-processing software (Photoshop, Lightroom, GIMP, etc.).
The way to avoid this happening is to use the HSV (hue-saturation-value) model for colour images. I will explain how this can be done in GIMP. I rarely use Photoshop, so I cannot give an equivalent method for that software, but I expect that something similar is possible (it may be quicker and simpler in Photoshop, but I don't know).
How To Do It
The steps listed below work in GIMP 2.8.
- Open the image in GIMP and do any initial processing that you require.
- Select Colours - Components - Decompose... and in the dialog box select 'HSV' as the Colour model and remove the tick from the box Decompose into layers. Three new windows open up containing the hue, saturation and value components of the image. Each is shown as a greyscale image, but only the value component looks like a b&w version of the original image.
- Select the value window (identified by the word 'value' appended to the filename) and select Edit - Copy to copy this image.
- You can now delete all three new windows for the hue, saturation and value components as they are no longer needed.
- Select the original image window (which remains unchanged from Step 1) and select Edit - Paste as - New Layer to paste the copied value component into the original image. The bottom layer is the original image and a new layer has been created containing the value component (which itself looks like a greyscale version of the original image). At this stage the visible image is this greyscale image.
- In the Layers dialog window, click on the new layer (called 'Clipboard') to select it, then change the Mode box to show 'Value' (the very last item in the drop-down list). The visible image now reverts to the original colour image.
- Make sure that the top layer remains selected in the Layers dialog window and open whatever tool you wish to use to alter the brightness and contrast of the image (in the examples below I have used the Curves tool). In the dialog box for that tool, provided the Preview box is ticked, you will see a correct preview of the result. Remember that the top layer is a greyscale layer (even though it represents the value component of the image) and only tools that operate on greyscale images are relevant.
- When the image has been adjusted to your requirements, select Image - Flatten Image to combine the two layers back into one.
- Continue with any further processing (e.g. sharpening) in the normal way.
In this example we show what happens when different amounts of contrast reduction are applied. In the final case, the contrast has been reduced to zero by increasing the output level to the maximum everywhere (in the Curves tool, the curve is a horizontal line along the top of the chart).
|The original image.|
The Science Behind This
The RGB Model of Colour
Colour images are normally represented using the RGB model of colour. Each pixel in the image is represented as three numerical values for the red, green and blue components of the colour. This representation is very convenient for both creating the image using a camera or scanner, and for displaying it on a computer screen or other type of electronic display. The camera has separate sensors for red, green and blue; while the display screen uses separate red, green and blue phosphors to display the picture. For printing the image on paper, the CMYK model is generally used as it corresponds more closely to the colours used in printing inks, but that doesn't concern us here as post-processing is almost always done in the RGB model.
Although the commonly used software such as Photoshop works primarily in the RGB model, some useful image processing operations cannot be done in this model. It is not possible to make large changes to brightness and contrast without changing the colour saturation and hue of individual pixels. Using the Curves tool as an example, even if the same curve is applied to all three colours (red, green and blue), the effect can be to change both the saturation and hue as well. As these changes happen non-uniformly across the range of colours, they cannot be compensated using the Saturation and Hue sliders.
The HSV Model of Colour
In the HSV model, each pixel in the image is represented by three numerical values (called h, s and v) for the hue, saturation and value of the colour of that pixel. In this model, v represents the brightness of the colour only. So changing v changes the brightness of that pixel, not its colour in other respects (which is determined by h and s). Mathematically, v is defined as v = max(r,g,b), where r, g and b are the red, green and blue values.
For example, suppose we are looking at a sheet of red paper. The brightness of the illumination does not affect the hue h or saturation s of the light reflected by the paper (which is what our eyes and the camera see), but it does affect v. In other words, the sheet of paper does not change colour when you turn up the light, but it does appear brighter. Similarly, if you turn out the light completely, it goes black (v = 0).
The precise mathematical definitions of h and s are rather more complicated and don't really matter to us at the moment, so I will not attempt to give them. If you wish to find out more, Wikipedia has a very comprehensive article on the HSV model under the title 'HSL and HSV'. One important property to know is that if s = 0, the colour is white or grey or black. So in a greyscale image s =0 for every pixel. Also, if s = 0 the value of h is ignored (the hue has no meaning if the colour is grey or white).
Flag as inappropriate
The views and opinions expressed in this article are those of the author and do not necessarily reflect the views and opinions held by dpreview.com or any affiliated companies.