Underexposed Rescue

9th Feb 2006, sjh

1) Overview

Occasionally it happens that you end up with a photo that is just hopelessly underexposed, or perhaps some sections of the photo. Fortunately, unlike over-exposure, underexposed images can often be restored to at least look reasonable.

At first thought one would think that it could simply be a matter of using levels or curves in your favourite image editor to brighten up the image. This is basically true, but there are a number of issues that mean it doesn't work so well in practice. One of those is that the noise levels are also amplified along with the image, making the image look grainy. Possibly more serious however is that the colour will often look unnatural. This is partly because of the smart algorithms for the colour processing in the camrera. They are tuned for the exposure to basically be correct, and fiddle the colours so that the image has the right characteristics under those situations. However, when it is greatly underexposed, then that processing can do more harm than good, and can easily leave the image with colour casts or a flat appearance.

What We Don't Want

Here is one such example of an underexposed image that I have brightened by just applying levels over the whole image.

What We are Aiming For

The aim of this tutorial is to instead get an image looking more like this with some saturation of colours and apparant contrast:

Procedure Summary

There are two main stages to the workflow taken on this image. The first is to get the overall image to have the right brightness characteristics:

  1. Linearly brighten the image as much as possible without clipping.
  2. Use a separate layer to get the overall brightness correct.
  3. Blend the layers to restore blown-out highlights.
  4. Again tweak the overall brightness and correct for casts.
  5. Increase the saturation.

The second stage is to do localised adjustments to the image in order to return more life to the picture.

  1. "Paint-with-light" to selectively highlight and shadow image areas
  2. Selectively saturate and destaturate areas.
  3. Touchup with paintbrush and cloning
  4. DOF reduction through blurring.

Currently this tutorial is only available for The GIMP. A Photoshop version may come soon, although mostly the same approach can be followed.

2) Overall Image

The image we are starting with looks something like this one, initially perhaps looking beyond all hope. ( Image courtesy of Marion on dpreview forums, not to be redistributed.)

Linear Brightening

The image is very dark, so the first job is to use curves to brighten it up to at least use the full dynamic range. At this stage we want to use a straight line to avoid changing any colour properties of the image. The idea is to brighten it up as much as possible without clipping any highlights. In a later stage we will brighten it more, but here we want to preserve as much of the image data as possible.

Overall Brightness

Now duplicate the layer to to keep this state of the image while we brighten it up even more. Call this new layer "Bright" On the new layer on top, again apply curves, but this time to brighten the main part of the image to a reasonable level. Don't worry about the clipping of the bush in the foreground, as that will be restored in the next stage.

Dynamic Range Compression

There is a problem with dynamic range in this image. The foreground grasses are much brigher than the rest of the image, and so we need to selectively adjust the image. One way of achieving this is to add a layer mask to the top layer, and use it do erase the clipped areas and leave the better exposed image below to show through.

Here we add the layer mask, and copy the top layer image into the mask itself. Then invert the colour on the layer mask. That way bright parts in the image will be dark in the mask, so making that part of the layer invisible.

  1. Right-click on the Bright layer and select Add Layer Mask. Now the layer will consist of two separate layers: the layer itself, and the mask layer which determines how opaque the layer is at each pixel.
  2. (GIMP Specific) In the dialog, choose to initialise the layer mask to Grayscale Copy of Layer, and tick the box to Invert Mask
  3. Alternatively if your editor doesn't give the above options when creating the mask:
    1. Click on the Bright layer icon showing the image itself
    2. In the image select all and copy
    3. Click on the Bright layer mask icon
    4. Now paste into the image
    5. Invert the image black-for-white. If there is no option to do this, you can use curves with a straight line from the top-left to the bottom-right.

The result of doing this is very washed out because of the loss of contrast in the image. One way of starting to restore this is to apply a gaussian blur to the layer mask. This means that it only affects larger areas rather than cancelling out all the variations in detail.

At this stage it may help to work with curves on the layer mask to tune the blend between the two layers. Here it doesn't work too badly without it so we just leave it as as and merge the two layers again.

Further Adjustmant

With the merge, the image is still too dark, so we can again apply curves to bring it up to the desired brightness. By making it a curve we can brighten up the midtones more. This will desaturate the highlights somewhat, but that isn't a problem here as the highlights are already more saturated than the main image. Also there is a bit of a kick down at the bottom of the curve to help make the image look more contrasty.

There also appears to be a bit of a green cast, so we can drop the green back a little in the green channel of curves to balance out the colours.

More Saturation

Although the brightness is now fairly close on the image, it still looks very dull and grey. The way to fix this is to add some saturation, but not so much as to have any areas look unrealistically bright. This is done with the Hue-Saturation adjustment and increasing the saturation slider.

That's about all we can do with the overall image, and the remainder will mainly be working at adjusting areas of the image individually.

3) Selective Image Adjustment

This section is mainly about manipulating parts of the image selectively to restore a more original looking colour and balance between the image without adding too much additional grain. To do this, I'll be making good use of layer masks to paint the effect in or out.

Painting With light

We now duplicate the layer twice to provide two extra identical layers (adjustment layers could also be used if available on your editor). Of these two layers, one will be called "light", and the other "dark". Curves are used to lighten and darken each respectively. A layer mask is added to each, and initially set to black, so that they don't have an effect.

Now it is time to get out the paintbrush, preferably using a tablet, and painting into the layer masks to lighten or darken areas of the image. You can use whatever tool is appropriate for the area. For a large area, it could be the lasso tool and paint bucket or a gradient fill. It can also be useful to do blurring in the layer to smooth things out.

Note that it is over-done in this example to show what is done, and there has to be sufficient subtility and consistency to make it look realistic. Specific things I've done here include especially isolating the flying turkey more, by brightening up its highlights and darking the surrounding background in the area to provide more contrast. Similarly, around the neck, I've darked the bird, and lightened the background grass.

Another thing to try is to sculpt the landscape more to make it look less flat, by forming more shadowed areas with dark, and building up some highlights more.

Localised Contrast Enhancement

To add more definition, I have now added a localised contrast enhancement. This is done by applying the unsharp mask with a large radius. Here the radius is 50, and the amount 0.15. At this stage too, I've also used the paintbrush in colour only mode and lower opacity brush to paint in the red head colouring.

If you used adjustment layers above, then here you alter the original lower layer, otherwise merge the above layers back to one before this stage

Painting with Saturation

Following this, I perform another painting with light procedure, but this time instead of dark and light layers, it is with saturated and desaturated layers. The main aim is to desaturate out the green artifacts off the logs and rocks, and well as brightening up some of the grass and the bird. The desaturation of the grey areas helps a lot in emphasising the colour of the other coloured parts. Time also to clone out the distracting grasses on the far bank.

Depth-of-Field Reduction

Now I want to clean up the background more. This picture was taken with a narrow aperture, and so the depth of field is quite large. Seeing as the background is blotchy and distracts, we can make it both cleaner and less distracting with a gaussian blur. Here I duplicate the layer and apply a gaussian blur radius 5 to the top layer. Then add a layer mask to that layer, initially set to black. Painting in the mask will then select the areas to be blurred. That is primarily the background, which is done with a bucket fill, and then gently brushed up to the bird.


Without being quite so aggressive with the PWL, the result is more like the following image. With the DOF blurring, the foreground and background separate more, and so the contrast becomes even more exaggerated. Some other things to help the final image include some blurring of the noise and colour-painting of the water to overcome some artifacts from the original jpg compression.

Related Pages