SLR CameraPoint and Shoot Camera
shaded top background

Going beyond basic curves


Table of contents

An "all-in-one" method for moderating excessive contrast

In my previous article on using the curves dialog, I ended by saying that although the image had been improved by applying a curves adjustment, it wasn't an ideal solution. In that article, the image now had better shadows and greater mid-tone contrast, but the highlights were now washed out. In improving one defect, I'd made another one worse. There are lots of ways to apply adjustments to selected parts of the image, and that's the fundamental answer to the problem. Sometimes this is easy, and you can simply use your mouse to select one part of the image, feather the selection so that you don't see a harsh boundary between the adjusted part of the image and the rest, and then apply your curves or other adjustment to the selected area only. This is often all you need to do in landscape images where the sky is already close to over-exposure, but the land is too dark. The boundary between sky and land is usually obvious. You select the land, apply curves to lighten it, and leave the sky as it is. It might take a bit of practice to get it right, but it's basically straightforward enough.

But what about an image where the bits you want to adjust are harder to select? In this article I'm setting out a method that can be applied to any image, complex or simple, in which the decisions about where to draw the selection are both automated and yet can be precisely controlled.

The technique uses a concept I introduced in my article on sharpening, that of creating a selection mask. In this case, however, the way the selection mask is created is very different. A new concept is introduced, that of blending modes. As ever, I'm using the free GIMP software to illustrate the technique.

The image I'm working on

Image:Original contrast.jpg


In this image of the Cathedral in Granada, Spain, the shadows are a little too dark to see all their detail. It's also true that the shadows are not all that easy to select simply using the free select tool. It could take quite a long time to select all the areas you might want to adjust. So this is where the selection mask concept comes in very handy. In the sharpening article, the selection mask was created using edge detection and gaussian blur. In this case, we're going to use the threshold dialog to create the mask.

Step by step

  • Step 1. Duplicate the image by right-clicking in it, and selecting Image:Duplicate from the context menu. In the original image create a new channel by using the Layer, Channels, Paths window. You first select the channels tab, and then click on the new channel button, as illustrated. (Note: I've used the same image of the Layers, etc window that I used in the sharpening article, and so the tiny thumbnails don't correspond to the image I'm working on in this article, but that's not important.)

Image: TLF_sharpening_channels.jpg


  • Step 2. Go to the duplicate image, and select Tools:Color Tools:Threshold... from the menu bar. Enter "0" into the left hand box in the dialog, and use the right hand slider (white) to adjust the image. You need to use your judgement, but the idea is to make all the shadow areas you are wanting to adjust white, and the rest of the image black. You should end up with something like this, and when you are happy click on "OK" in the dialog to confirm:


Image: TLF_Threshold.jpg


  • Step 3. Now with the back and white image (i.e. the duplicate image) as the active document, choose Edit:Copy. Then make the original image the active document by clicking on it, and then choose Edit:Paste, ensuring that you are pasting into the new channel that you created earlier.
  • Step 4. In the Layers, Channels, Paths window, select the layers tab, and then click on the little anchor symbol to fix the floating layer. Select the channels tab again. If you've completed this step correctly, the new channel's little thumbnail will now be displaying a tiny black and white image. (At this point it's a good idea to make sure that you're displaying your image at 200%. The next step will be to convert the channel to a selection, and sometimes this will mean a very complex selection indeed. I've found that the GIMP will sometimes hang when trying to display highly complex selections at small magnifications when the "marching ants" of the selection become impossibly convoluted.)
  • Step 5. In the Layers, Channels, Paths window, click on the little pink square to convert the channel to a selection. Even with a powerful computer this can take a few seconds, so be patient. Eventually you will see the "marching ants" indicating that the selection has happened.
  • Step 6. Still with the image displaying at 200%, choose Select:Feather... and enter a value equal to 10% of your image's longest side. For this 3296x2440 pixel image, I feathered by 330 pixels. Once again, even a fast computer can struggle with the fiendish calculations involved in feathering a complex selection, so more patience may be required. The 10% is not a hard and fast rule, and it's worth experimenting. The determining factors are that the higher the level of feathering, the smoother will be any transitions between shadows and the rest of the image: on the other hand, the smaller the amount of feathering applied to the selection the more "precise" the effect will be, and therefore you can have an effect on small areas of the image, although you may also have sudden gradations of tone that make the result unrealistic. Balance is the key, and experimentation will help you achieve it.
  • Step 7. Now that you've feathered the selection you can safely reduce the magnification to the normal 20% to 50% that enables you to see the whole image in its window. In the Layers, Channels, Paths window select the layers tab. Create a duplicate layer, which will also display the "marching ants" of your selection. Now choose Edit:Copy, and then immediately choose Edit:Paste. In the Layers, Channels, Paths window you will now see a new layer labelled Floating Selection (Pasted Layer). Right click in this layer and choose New Layer... from the context menu as illustrated below:


Image: TLF_Contrast_Floating_New.jpg


  • You should by now have three layers in your image: the background layer, a copy of the background layer, and the new layer you've just created. Obviously the first two layers mentioned will be identical, but the new one is very different. If you turn off the visibility of the background and copy layers by clicking on their eye symbols, you will see only the third new layer you've just created, and it will be a ghostly partial image. Lots of it will be missing, and replaced by a grey checkerboard that the GIMP uses when an image, or part of it, is empty. Some parts of the image will be very faint, and this is the result of the feathering. The clearest parts of this layer will be the deepest shadows of your original image, and the least distinct parts will be the shadows that were less deep, and nearer to mid-tones or highlights. What we have done here is use the threshold dialog to select automatically the parts of the image we are wanting to adjust. By judicious use of the threshold dialog, and by combining it with different degrees of feathering, we can control the selection very precisely.
  • Step 8. So we've got the shadows in a separate layer, and we can now do things to them independently without affecting other parts of the image. You could apply a curves adjustment to this "shadows layer" in exactly the same way as I described in my article "A basic curves tutorial". In this case I used a different method. Make sure all your layers are visible (i.e. they are all displaying their eye symbols) and with the top shadows layer selected, click on the mode drop down box, and choose Screen. Magically, all your shadows will become significantly lighter, but all your mid-tones and highlights will be largely left as they were. "Screen" is one example of what is called a "blending mode", and you will notice that there are lots to choose from, and some of them produce very odd results indeed! In this case, screen is definitely the one we want. If you now right click in the top layer that you set to the screen blending mode, you can choose Merge Down from the context menu. You still have your original background layer, but the background copy layer is now a mixture of the original layer and the screen blending mode that was applied to the shadows layer (that you will also notice has now disappeared.) You can see the effect clearly by switching the visibility of the copy layer on and off using the eye symbol, and directly comparing the original with your adjusted version. You can exercise even further control, if you feel that your new layer has overdone things a bit, by adjusting its opacity using the slider. Once you're sure you're finished, and you won't want to make any more adjustments, right click in the background copy layer in the Layers, Channels, Paths window, and choose Flatten Image.

The results

The adjusted layer looks like this:


Image: Contrast_Adjusted_Result.jpg


I think that if you compare this with the original image you'll agree that there has been a significant opening up of the shadows, with very little or no degradation of the mid-tones or highlights. This is perhaps easiest to see in the arch of the doorway, and in the foreground street. The two comparisons below will make it clear:


Before: Image: Original_contrast_Arch.jpg After: Image: Contrast_Adjusted_Result_Arch.jpg



Before: Image: Original_contrast_Street.jpg After: Image: Contrast_Adjusted_Result_Street.jpg


It always takes a long time to describe a technique like this step by step, and you may have formed the impression that all this is hopelessly complicated and time consuming. Let me assure you that it isn't! It's actually quick and easy. With practice you can do all this in no time: I promise you that it took me only about three minutes to work on this particular image! I know of no other way in which you can have so much control at the same time as so much automation, so please have a go!

About the author

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.

shaded bottom background
spacer