Photo Touch Up and Enhancement in the GIMP

The GIMP is an excellent tool for photo touch up and enhancement. Photos which are scanned or come from a photo-CD or digital camera can suffer from both esthetic and processing defects. This can be due to problems of contrast, color casts, color saturation, dynamic range, blur, scratches, etc. Furthermore, most photos, no matter how carefully composed, need some enhancement to achieve their full potential. The purpose of this tutorial is to explain how the GIMP can be used to touch up and enhance your photos.

The sequence of steps is fairly straight forward and consists of:

Improving the dynamic range of the image and adjusting midtones
Removing any unnatural color casts
Making the photo warmer by saturating colors
Separating the subject from the background, if necessary, using selection tools
De-emphasizing the background through lightening, blurring, or color desaturating tools
Sharpening the Image
Repairing blemishes

Each of these steps is described in detail in the following sections. The photo in Figure 1 will be used to illustrate the process of photo retouching, enhancing, and color correction in the GIMP.

Figure 1: Initial Photo

Before beginning several observations can be made concerning this photo. First, the photo is dark and clearly under-exposed. Second, the colors are ``muddy'' and there is an overall lack of sharpness. Third, the photo has a green tinge or color cast to it. Fourth, the subject matter, the cowboy roper with the children, is poorly separated from the background. Finally, there is a relatively bright green spot on the left hand side of the photo which will blemish the final product if not removed. In a nutshell this photo needs a lot of help. This photo will be significantly enhanced by the steps described in what follows.

Although each photo is different the techniques used to address each of the problems in this photo with the GIMP will be found to be generally useful. Caveats to the following procedures will be mentioned.

Improving Dynamic Range

The first task required in touching up a photo is to ensure that it makes use of all available dynamic range. Part of the reason that colors may look muddy in a figure is that whites are not fully white and blacks are not fully black. Whether an image is making use of all the available dynamic range can be determined by looking at the value histogram of the image in the Levels tool as is shown in Figure 1.

Figure 1 was obtained by using the right mouse button in the image window to obtain Image/Adjust/Levels. This brings up the Levels dialogue box as shown here on the left.

Figure 2: Levels Dialogue

Figure 3: After Adjustment to Shadow Level

As can be seen the histogram of values is not fully distributed over the range of input values. In particular the histogram shows that the darkest values in the image are only half way between a medium gray and black. This can be corrected by stretching the image's values to be distributed over the entire input range which is accomplished simply by dragging the left input endpoint arrow to line up with the beginning of actual shadow values of the image as shown in the dialogue box in Figure 3. This causes the image values to be redistributed so that they range from the darkest black to the lightest white. This can be seen in Figure 4 below which compares the original image with that corresponding to the one with stretched dynamic range.

Figure 1: Initial Photo

Figure 4: Extended Dynamic Range

As can be seen the dark values are now much blacker (for example, notice the cowboy's shirt). However, overall the image has been made much darker. This can be corrected by adjusting the image's midtones by moving the middle input arrow of the Levels dialogue slightly to the left as illustrated in Figure 5.

Figure 5: Levels Dialogue After Midtone Adjustment

And with the resulting image shown here in Figure 6 next to the overly dark image from Figure 4. Normally, adjusting an image's dynamic range improves its overall look. This is not always the case, though. For example a photo of white lace on a white dress would have most of its pixels over the white, highlight values of the histogram. Stretching such a histogram to the full dynamic range would make some of the white lace look black which might be undesirable.

Figure 4: Extended Dynamic Range

Figure 6: Adjusted Midtones

The original image had rather muddy colors at least compared to this new image whose dynamic range and midtone values have been corrected. Nevertheless, Figure 6, which has been corrected for dynamic range and midtone values, has a definite green tint to it. This is addressed in the following section.

Removing Color Casts

The GIMP has many tools which can be used for color correcting images. The most powerful of these is Curves found in Image/Adjust/Curves. Color imbalance is rarely uniform over all value levels in an image. Normally, the color imbalance manifests itself in a particular value range (Shadows, Midtones, or Highlights). Curves allows the image to be corrected in the appropriate value zone.

Unfortunately, the GIMP does not allow the precise color correction that is available in PhotoShop. This is due to the fact that the Color Picker does not work in conjunction with Curves. The Color Picker is a very powerful tool for identifying exactly which areas of an image have a color imbalance problem and at which brightness level the correction needs to be applied. In PhotoShop the Color Picker can work simultaneously with Curves and in addition image values queried with the Color Picker can be made to appear directly on the Curves display. This allows for very precise color correction in PhotoShop since Curves can be adjusted exactly where it is needed.

Even though the GIMP is less powerful than PhotoShop in its ability to identify and precisely modify color in specific value zones it is still possible to reasonably correct for color imbalance using the GIMP. The following discussion shows how.

Opening the Image/Adjust/Curves dialogue box and selecting the green channel from the menu button at the top would reveal Figure 7 with only two control points on it.

Figure 7: Curves (Green) Dialogue Box

Figure 8: Adjusted Green Curve

In Figure 7 three control points have been added to the diagonal line which represents the map from input to output green values. The control points were added to the curve simply by clicking the mouse on the line. Notice that each control point was carefully placed at the 1/4, 1/2, and 3/4 brightness locations. These points represent the mid-points of the shadow, midtone, and highlight zones for the green channel, respectively.

The placement of the three control points will allow the independent modification of the values for the three zones they occupy. That is, the shadow values of the green channel can be darkened (or lightened) without affecting the midtone or highlight values as is demonstrated in Figure 8 above. This is exactly what is needed to remove the green color cast in the image as can be seen in comparing the two figures below corresponding to the two curves figures above.

Figure 6: Adjusted Midtones

Figure 9: Correction of Green Color Cast

As can be seen, although still quite dark, the hues in the corrected image are much more natural. This type of precise control of the individual color channels is the most powerful color correction tool in the GIMP. Although there are other tools which control color such as Color Balance and Filter Pack these tools only control the shadow, midtone, and highlight zones. The Curves tool allows for precise control over a zone or zones specified by the user. This would be quite useful if the user could identify specific regions in the image which needed adjustment, evaluate the current and needed color levels, and then apply the changes in the Curves tool. This, unfortunately, is not possible in the current version of the GIMP since the Color Picker tool cannot work in conjunction with the Curves tool. Let's hope that this feature will be available in a future version of the GIMP.

In lieu of the use of the Color Picker the procedure used to color correct the above image using the green channel of the Curves tool was as follows. For each of the shadow, midtone, and highlight zones the control point was moved slightly up and down perpendicular to the slope of the curve to see whether the effect improved the overall look of the image or not (the preview radio button must be on for this to work). Improvements were kept and deleterious effects were discarded by replacing the control point to its prior position. In this iterative fashion an acceptable color correction was found.

Warming an Image with Color Saturation

After stretching dynamic range and correcting for color casts it is often nice to warm up an image by boosting a bit the color saturation. This can be done with the Hue-Saturation tool. Clicking on Image/Adjust/Hue-Saturation brings up the dialogue box in Figure 10.

Figure 10: Hue-Saturation Dialogue

Figure 11: After Saturation Adjustment

Leaving the "master" radio button on and sliding the "Saturation" button to 15-20% as shown in Figure 11 often improves the warmth of the colors (if they are not already fully saturated). This can be seen by comparing the previous iteration of the enhanced image, shown in Figure 9 on the left, with the boosted color saturated one in Figure 12 on the right.

Figure 9: Correction of Green Color Cast

Figure 12: Color Saturated

Using Selection to Target Improvements

The GIMP procedures described to this point have improved somewhat the image. However, the image used here was taken under dark conditions and consequently the subject in the foreground does not stand out well against the background. This can be remedied by using the GIMP's selection tools to separate the background so that it can be processed independently of the subject.

Using the Bezier Selection tool from the GIMP Toolbar and using the Zoom tool when necessary the subject of the image was selected. The background was then selected by inverting the selection using Ctrl-I or with Select/Invert from the image menu. This yields the background selection shown in Figure 13.

Figure 13: Selecting the Background

De-Emphasizing the Background to Bring Out the Subject

To make the subject stand out the background needs to be lightened. This is easily accomplished using the "brightness" slider of the Image/Adjust/Brightness-Contrast dialogue box from the image menu shown in Figure 14.

Figure 14: Brightness-Contrast dialogue

The result of brightening the background by 35 percent is shown in Figure 15 and is compared with Figure 12 to the left.

Figure 12: Correction of Green Color Cast

Figure 15: Background Lightened

In addition to lightening or darkening a background to better emphasize the subject several other processing tricks can be performed. For example, often just blurring the background somewhat using Filters/Blur/Gaussian Blur (IIR) will make the detail in the subject stand out. Another possibility is to desaturate the color in the background to make the color of the subject stand out. This can be done by clicking on Image/Adjust/Desaturate to completely remove the color or by using the Hue-Saturation tool to diminish the level of saturation.

Sharpening the Image

Often a photo is slightly blurred or out of focus. Furthermore, multiple operations on an image such as those applied in performing enhancement, touchups, and color correction can also make a photo look a little blurry. To remedy this, the sharpen filter in Filters/Image/Sharpen... from the image menu can be used to recover some lost crispness and to sharpen up the image.

In this case the subject of the example image could use a little sharpening. The selection is thus inverted once again (using either Ctrl-I or choosing Select/Invert) so that the subject is now the active selection. Then clicking on Filters/Image/Sharpen... calls up the sharpen dialogue box as illustrated in Figure 16.

Figure 16: Sharpen Dialogue

Normally, the sharpen filter comes up with a setting of 10. The setting in the above figure has been reset to 25. Experimentation using the preview thumbnail in the sharpen dialogue box as well as the direct application of the filter to the image and undoing (with Ctrl-Z) when necessary yielded the result as shown in Figure 17.

Figure 15: Background Lightened

Figure 17: Foreground Sharpened

Removing Blemishes

Finally, any unwanted detail or blemishes in the image can be removed using the clone tool. The clone tool found in the GIMP Toolbar uses one part of an image as a pattern for replacing another part. This is accomplished by first clicking on the Clone tool button in the Toolbox and then the part of the image to serve as the clone is indicated by left mouse clicking the image with the Ctrl key held down in the desired region of the image. The Ctrl-click should be in a part of the image which contains the color to be used in the cover-up. Then regular left mouse clicking on the blemish area fills in the color of the blemish with that from the Ctrl-clicked zone. The result of this type of operation can be seen below in Figures 17 and 18. In Figure 17 a bright green spot can be seen on about 3/4 quarters up the left side of the image near a part of the lasso. Figure 18 shows the same image with the blemish eliminated.

Figure 17: Foreground Sharpened

Figure 18: Blemish Removed

Final Comparison

Finally, the modified image can be compared to the original image to determine whether the final result is satisfactory. The comparison between Figures 1 and 18 is shown here:

Figure 1: Original Photo

Figure 18: Final Corrected and Enhanced Photo

The new image has several qualities worth noting. First, the colors of the enhanced image are much sharper and better defined. In comparison the original image's colors are "muddy". This is due primarily to the correction in dynamic range and the saturation of colors. Second, the green tinge in the original image has been largely eliminated in the enhanced image. The subject of the enhanced image is also sharper and better defined against the background. This is due to the Sharpen... tool and the reprocessing of the background with the help of selection tools and the Brightness-Contrast tool.

Carey Bunks