
| Table of contents |
This is not an article about taking up glamour photography (sorry, boys!) but a first look at using perhaps the single most powerful and useful feature of digital editing programs. Only relatively high-end programs have the curves function, so you may not be familiar with it if you use Photoshop Elements, for example. For this tutorial I’m using the GIMP (as usual) because this free program has a very sophisticated curves capability, and no-one can say that they can’t afford it! If you'd like to try it, the GIMP can be downloaded from GIMP for Windows (http://gimp-win.sourceforge.net/stable.html). On this page you can also download the GTK+ 2 runtime environment which you need to install before installing the GIMP itself.
The first part of the article explains the theory behind the curves function, and the second demonstrates its use in a real example.
Curves is a dialog that allows you to alter the relationship between the luminance (brightness) input and the luminance output. In digital photography, any pixel in the image can have a luminance value between 0 (pure black) and 255 (pure white). By default, every pixel in the image is displayed at the same luminance that it has ascribed to it in the image file. So if in your image a pixel has a luminance of, let’s say 60 (in other words it is in a relatively dark part of the image, perhaps a shadow area) then it will be displayed at luminance 60. Using curves you could alter this relationship so that all pixels with a luminance of 60 display with a luminance of 80. You cannot of course remap the luminance of each pixel individually (and you’d be at it rather a long time if you could, since adjusting 6 million pixels would be a slow old task) so curves changes the luminance output for all pixels to a greater or lesser extent. But for all pixels of the same input luminance, curves will give them the same output luminance. The curves dialog is basically a graph, but a graph that is showing you two very different kinds of information at the same time. It’s important to understand that when you see the curves dialog you are seeing two different kinds of graph super-imposed one on another. One is a line graph showing you how input luminance is related to output luminance. The other is a histogram showing relatively how many pixels have each input luminance. For the line graph the horizontal (x) axis plots input luminance from 0 to 255, and the vertical (y) axis plots output luminance from 0 to 255. For the histogram, however, the x-axis again shows input luminance, but the y-axis plots the number of pixels in the image that have that input luminance. As you flex the line (i.e. make it a curve, which is why this function is called curves) you can see the distribution of pixel output luminance change to reflect the new relationship. This new distribution is not displayed in the curves dialog, but in the output histogram which you can choose to display in the GIMP. Below are two screenshots of the curves dialog. The first is the default position, showing a straight line from the bottom left to the top right. When the line is straight, every input luminance produces the identical output luminance.
However, also note the histogram which is showing a large peak of pixels around the lowest quartile of luminance, and another peak at the far right of the chart which indicates that there are strong highlights which are clipped. In other words this image is both over-exposed and under-exposed! The highlights are already clipped, whilst most of the image is in relative shadow. There are very few mid-tones at all. This shape of histogram is characteristic of one of photography’s most difficult exposure problems: a back-lit image which is mostly in shadow, but with bright light from a sky or other strong illumination causing over-exposure of highlights. It’s also worth noting that at the extreme left of the histogram, there are no pixels at all, showing that the blackest parts of the image are not completely black. This probably means the shadow contrast is not as high as it should be which often indicates that there is flare in the image. Compare this with the second screenshot:
There are three main things to note about this curve. First, the left hand end of the curve no longer goes through the origin of the graph (0 input and 0 output luminance: in the following section all positions on the graph are indicated by x and y co-ordinates, thus (0, 0)) but is pulled along the x-axis until it touches the left most edge of the mass of pixels in the shadow area. The new origin of the curve is not (0, 0), but (17, 0). In other words, those pixels in the original image that were nearly but not quite black (luminance 17) are now pure black (luminance 0). This is known as “adjusting the black point”. Second, the straight line of the first dialog is now strongly curved. If you look at the little dot on the curve, it is telling you that pixels with an input luminance value of around 100 are now mapped to an output luminance of around 170, which is considerably brighter. I have superimposed on this dialog the original straight line going from (0, 0) to (255, 255). Everywhere the new curve is higher than this straight line, pixel luminance has increased: where it is lower, luminance has decreased. You can see that in the vast majority of cases pixels will be brighter, but a few in the deepest shadows will be darker. Third, the part of the curve that is to the left of the little dot is now at a steeper gradient than the original straight line was, whilst the part of the curve to the right of the dot is now at a shallower gradient than the original straight line. This is important because the gradient of the line or curve is a measure of the contrast of the image. The steeper the gradient, the more contrasty the image. Contrast is a measure of how quickly brightness increases. If a section of the image is a lot brighter than its neighbour, then it has high relative contrast. If the curve is steeper than the straight line, it means that every time input luminance increases by 10 value points, the output luminance increases by more than 10 points – higher contrast. Conversely, where the gradient is shallower, every time input luminance increases by 10 value points, output luminance increases by less than 10 points – lower contrast. So in this case we can see that contrast in the shadow regions of the image has increased whilst in the mid-tones and brighter parts of the image, contrast has decreased. Whatever way you flex the curve, some parts of the image will gain contrast, and some parts will lose contrast. This is inescapable.
Here is the output histogram which relates to this curve:
Compared to the input histogram shown in the curves dialog, we can see that the peak of pixels with low luminance values has been spread out so that now there is no gap between the left hand edge of the graph and the left hand edge of the peak of pixels, and the right hand edge of the peak has moved quite a distance to the right along the x-axis. This shows that there are now more pixels in the mid-tone region than there were before, and that therefore the shadows are now brighter than they were. So we’ve got brighter shadows with greater contrast. We’ve also got brighter mid-tones, but these now have lower contrast as well. Also note the gaps that have appeared in the histogram. This is because the same number of pixels has now been spread across a greater range of luminance. These gaps mean that the image has been damaged, and in photography, just as in life, there is no gain without pain. Although, when we see the real image that these graphs describe, we’ll see that it looks better, it will have been distorted in the process. There is therefore a balance to be struck between improvement in appearance, and underlying damage.
Curves and histograms tell us a great deal about an image without even having to see it. Just by looking at them we can tell how much of the image is in shadow, how much is in bright light, how much is over-exposed, how much contrast there is in different parts of the picture, and whether the darkest parts of the image are truly black, or the brightest parts truly white. Up to this point I’ve been talking about overall luminance across all three red, green and blue channels. Curves can also allow us to alter the relationships between input and output luminance in each colour channel independently, and this is one powerful way of eliminating colour casts. But that must wait for another article.
So now we can reveal the real life image that the curves dialogs and histograms that I’ve been describing are actually telling us about. And here it is.
Just as I said, this image has got several problems. It was shot into the sun (it’s hiding just behind the wall at the left hand edge) and so most of the image is in shadow (hence that peak of pixels to the left of the histogram) but there is also a large expanse of sky which is already over-exposed and has lost a lot of its colour. Finally, although the shadows dominate, ironically they aren’t as dark as they should be in the really dark bits, and they’re too dark in the mid-tone areas. In other words, they lack contrast, and this is a result of flare from the lens as it tried to cope with the backlighting.
To bring up the curves dialog in the GIMP, choose Tools:Color tools:Curves…. You will see the dialog as shown in the first of the two screenshots above. Click with the mouse somewhere in the middle of the straight line, and move it around whilst watching the screen to see what effect you’re having on your image. How do you know what changes to make? Well, that’s where experience comes in, but I’d suggest the following check list as a guide:
In this case, I flexed the curve just as shown in the second screenshot above, and this produced the result below:
I hope you’ll agree that this is a lot better. Because the black point’s been adjusted, the deepest shadows are actually darker than in the original, whilst most of the shadow region is brighter than it was. In other words, shadow contrast has been increased, and the image has much more punch than it did. Has everything improved? Well actually, no, it hasn’t. The sky which started off washed out is now even worse. So I wasn’t satisfied with this, and in my next article I’m going to share a more complex curves technique that helps to minimise the compromises that this simple technique forces you to make. I wanted the shadows to be brighter and to have more punch, but I wasn’t prepared to ruin the sky to achieve it. So I developed another technique, and I’ll tell you all about it next time!
Steve Brown lives and works in London, and has moved from film to digital over the last two years. His main photographic interests are architecture and the French countryside. More of his images can be seen in his TLF gallery (http://www.thelensflare.com/profile.php/sgbrown) and on www.hautevienne.moonfruit.com.
