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. As far as I can tell, it is not possible in Photoshop and other common image processing software.
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 Layer - Duplicate Layer to create two identical layers.
- In the Layers dialog window, click on the new top layer to select it, then change the Mode box to show 'Value' (the very last item in the drop-down list).
- 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.
- 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 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.|
See also this more recent article.
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 commonly used software 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).
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.