<--Back to Part I of this article
The first thing to realize is that if you have a clipped channel in a JPEG (or TIFF) image, the information that would have been contained in that channel above a level of 255 is lost. Lost and gone forever. You cannot get it back. However what you can do is make a reasoned guess at what it would have been, so that the image at least looks closer to what it should.
If you were recording images in RAW mode rather than JPEG then the situation is a little better. RAW images contain more information than JPEGs derived from them, so you do have a chance at recovering information lost from the JPEG. How successful this is depends on just how overexposed a channel is. The JPEG sacrifices some information due to the tone curve that is applied to the RAW image. This tends to compress highlights and shadows in order to obtain a better looking image. With a RAW image there's direct access to the uncompressed original data and that may allow "recovery" of information that's recorded close to the maximum intensity any channel can record and which isn't shown in the JPEG.
Let's first take a look at a JPEG, which is the worst case since the information we need is gone. With a clipped red channel, the red value is pegged at 255. Increasing exposure simply brings up the green and blue channel levels, which lightens the image and distorts the color. We can't really derive the original color because we don't know what the red channel value should be if it wasn't capped at 255. It might have been 300, or 600 or even 1000. We just don't know. However what we can do is to lower the green and blue values of the pixels in which the red channel is at 255 until the color looks right (or at least better).
As before, the color of the bike is red. It's not pink as it appears in the area below the windshield, or orange as it appears on the gas tank. These color shifts are the result of a clipped red channel.
What we can do in this case is to take the original image and manipulate it so that the blue and green channels are reduced in value. This will bring the colors back closer to what they would have been if the red channel hadn't clipped at a value of 255. It may not bring back the exactly correct shade of red, but it will probably be close if the amount of correction isn't excessive. There are several ways to do this.
In the case of this image, all three methods restore the blown out red areas about equally well. You can call this image "red corrected" The color balance method gives the image an overall color cast and the gamma and image blending methods darken the overall image, but none of these effects are a real problem and are taken care of by the next step in the process...
...which is the creation of a layer mask which shows only the pixels for which the red channel is clipped. We do this as follows:
When a monochrome image such as this is made into a mask layer, the white areas will be transparent while the black areas will be opaque. We can label this image "clipped red channel". To slightly smooth transitions between layers it's not a bad idea to apply a slight gaussian blurring function to this image. Now we are ready to make the final image. We will make a multilayered image and blend it in such as way that the clipped red pixels in the original are replaced by the "corrected" pixels in the "red corrected" image.
What we have done here is to allow the darker pixels from the "red corrected" image to replace the pixels in the original image in the white areas defined by the "clipped red channel" mask. The white areas are transparent allowing the lower "red corrected" pixels through. The "darken" blend mode makes the pixels in the final (flattened) image the darker of either the pixels in the original image or the pixels of the "red corrected" image.
I should mention here that the above operations are by no means the only ones which can be used. For example you can use a saturation mask, or you can simply create two layers and use an eraser tool to make the blown out regions of the image transparent and allow the corresponding parts of the darker image show though. Depending on the image and the nature and extent of the clipped channels, one method may work better than others, but all will work to some extent.
If you shoot RAW you have a much better chance of actually recovering at least some of the clipped data rather than just guessing at what it might have been. The RAW file contains the actual data from the sensor. A JPEG file is a conversion of that data into an image optimized for typical viewing. As such a tone curve is applied which makes the mid tones look most natural. You don't usually want a JPEG to be created using a tone curve that shows every last bit of highlight detail if that also results in murky mid tones and black shadows.
What a RAW file enables you to do is generate several different JPEG images which can maximize information in either the highlights, mid tones or shadows. You can then combine these images in a similar way to that described above for "corrected" JPEGs by using the different JPEGs as layers and blending them together using a mask. The difference is that the JPEGs derived from the original RAW file contain more of the original image information than JPEGs which are simply modifications of other JPEGs.
The above images were converted from RAW files to JPEGs using Canon's DPP software. The leftmost image is the "normal" JPEG, i.e. what would have been saved by the camera as a JPEG. The center image was "developed" in DPP with a -1 brightness setting (which you can think of as being somewhat analogous to 1 stop less exposure) and the rightmost image was "developed" with a brightness setting of -2.
The above image shows the result of blending the "normal" JPEG image with the JPEG image developed from the RAW file with a -2 brightness setting in DPP.
It's also possible to combine different JPEGs derived from RAW files using different parameters into a single HDR (high dynamic range) image as shown below:
Of course not only the red channel can clip. The green and blue channels can also clip, and all three channels can clip at the same time. When all three channels clip at a value of 255 you get "blown out highlights", i.e. parts of the image appear as bright white with no detail. With JPEGs this is pretty much uncorrectable, but with RAW files there is a chance of getting back some information from those parts of the image if overexposure is slight.
Single channel clipping usually occurs when there are areas of saturated colors in the image. It can often be a problem when photographing flowers for example, where colors can be distorted due to single (or double) channel clipping.
Well, Photoshop CS5 an do everything described here, plus much , much more! For relatively simple operations like the ones used in this article, Elements 10 will also do the job as will Corel's Paint Shop Pro. HDR images can be creating using many applications including Photomatix and HDR Efex.
<-- Back to Part I of this article