Using Masking for Contrast Control in Photoshop

Article and Photography by Ron Bigelow

www.ronbigelow.com

Photoshop CS or Photoshop CS2 Used in this Tutorial

One of the main tasks in image editing is to manage contrast. Images with contrast problems, generally, are not very appealing. Specifically, in images with too much contrast, the high level of contrast tends to draw the attention of the viewer to the contrast and away from the main point of interest. This lessens the impact of the image. This article covers one tool that can be used to manage the contrast in high contrast images.

Creating the Image

Figure 1: Image with Contrast Issues

Figure 1 shows an image with contrast issues. The image contains both the sky, which is very bright and vegetation that is in the shadows. The exposure was set to keep the detail in the sky. As a consequent, the vegetation in the shadows is too dark and has poor detail. It is desirable to lighten the shadow areas without lightening the sky. This is easily done by the use of a mask that is created specifically to manage the contrast.

This particular image was shot in raw, so the process will be described for a raw image. The process can also be used for images that were not shot in raw. At the end of this article, the changes in the process that are required for non-raw images will be discussed (the changes are very minimal).

This technique requires five steps:

  1. Create the original image that maintains detail in the highlights.
  2. Create a new channel based on the contrast in the image.
  3. Create a second copy of the image that has detail in the shadows.
  4. Use the new channel to create a mask for the second copy of the image.
  5. Fine tune the image.

Create the Original Image

The image is opened in Camera Raw by choosing File/Open and selecting the file from the Open Menu (any other raw converter can also be used if the photographer so chooses). Figure 2 shows the image displayed in Camera Raw (this article assumes that the reader knows how to use Camera Raw). For the first copy of the image, the image is adjusted to keep detail in the highlights (for this particular image, the automatic settings work just fine).

Figure 2: Image in Camera Raw With Auto Settings
Figure 3: Image in Layers Palette
Clicking OK opens the image in the Layers palette (see Figure 3).

Create a New Channel Based on the Contrast in the Image

Figure 4: Channels Palette

The next step is to create a new channel that is based on the contrast in the image. This channel will later be used to create a mask that will be utilized to control the contrast in the image. For this, the Channels palette is selected. The Channels palette is shown in Figure 4. If not already selected, the RGB channel is selected. A selection of the entire image is created by choosing Select/Select All. The image is now copied by choosing Edit/Copy. A new channel is created by clicking on the Create new channel icon at the bottom of the Channels palette (see Figure 5). The new channel will automatically be labeled as the Alpha 1 channel. The channel should be renamed the Contrast channel. The image is now pasted into the Contrast channel by selecting that channel and choosing Edit/Paste. Next, it is necessary to invert the black and white image by choosing Image/Adjustments/Invert. The Channels Palette at this point is shown in Figure 6.

Figure 5: Create New Channel Icon on Channels Palette
Figure 6: Channels Palette with the Inverted Contrast Channel
The Contrast channel is shown in Figure 7. It is important to understand what has been done up to this point. The Contrast channel is now a black and white copy of the original image except that the tonal values have been inverted. In other words, the dark areas are now light, and the light areas are now dark. In essence, the contrast of the Contrast channel has been inverted from that of the original image.
Figure 7: Contrast Channel

Create a Second Copy of the Image that has Detail in the Shadows.

We now go back to the raw converter. The image is, again, opened in Camera Raw (or some other raw converter) by choosing File/Open and selecting the file from the Open Menu. The point of this second conversion is to lighten the shadows so that we can get more detail in the shadows and reduce the image contrast. For this purpose, the Exposure control is adjusted to increase the brightness of the image. At this point, it is okay if the image looks too bright, it will be fine tuned later. Figure 8 shows the image displayed in Camera Raw with the exposure control set to lighten the image.

Figure 8: Image in Camera Raw With Exposure Control Set to Lighten the Image
There are now two images open in Photoshop as shown in Figure 9.
Figure 9: Both Images Open in the Image Editing Program
Figure 10: Tools Palette

Image2 is now added to Image1 by the following steps:

  1. The Layers palette must be open in both images.

  2. The Move tool is chosen from the Tools Palette (see Figure 10).

  3. Image two is selected.

  4. The Background layer in the Layers Palette is selected.

  5. While holding down the Shift key, the Background layer for Image2 is dragged over Image1 and released.

  6. Image 2 will be labeled as Layer 1 in the file that it has been transferred. Rename the layer as the Shadow layer.

  7. Image2 is closed.
Figure 11: Layers Palette with Both Images
Now, both images are in the same file, and the Layers palette looks like Figure 11.
Figure 12: Image with Shadow Layer on Top
The image now looks as shown in Figure 12. The image looks overly bright because the Shadow layer is on top.

Use the New Channel to Create a Mask for the Second Copy of the Image

Figure 13: Load Channel as Selection Icon on Channels Palette

The Contrast channel is now used to create a mask that will be used on the Shadow Layer. For this step, we head back to the Channels palette. With the Contrast channel selected, a selection is created by clicking on the Load channel as selection icon at the bottom of the Channels palette (see Figure 13).

A selection has now been created based on the Contrast channel. Since the Contrast channel was inverted, in this selection, the dark areas of the Background layer are selected and the light areas are not.

Figure 14: Image with Selection
Moving back to the Layers palette and selecting the Shadow layer reveals the image with the selection as shown in Figure 14.
Figure 15: Edit in Quick Mask Mode on the Tools Palette

Before the selection can be used, it must be blurred a bit to soften the edges so that the mask that will be created from the selection will blend the two layers together smoothly. The selection is blurred by moving into Quick Mask Mode by clicking on Edit in Quick Mask Mode on the Tools palette (see Figure 15). Figure 16 shows the image in Quick Mask Mode.

The actual blurring is executed by choosing Filter/Blur/Gaussian Blur. This brings up the Gaussian Blur menu as shown in Figure 17.

Figure 16: Image In Quick Mask Mode

 

Figure 17: Gaussian Blur Menu

The only setting on the Gaussian Blur menu is the radius. The larger the radius, the greater the blurring. For this technique, only a small amount of blurring is required; a radius setting of two was chosen for this image. Clicking OK blurs the mask.

Clicking on Edit in Standard Mode on the Tools palette (see Figure 18) moves the image out of Quick Mask mode.

Figure 18: Edit in Standard Mode on the Tools palette

 

Figure 19: Layers Palette with Mask on Shadow Layer
The selection is now ready to be used to create a mask. With the Shadow layer selected, the mask is added by choosing Layer/Layer Mask/Reveal Selection. Figure 19 shows the Layers palette with the mask added to the Shadow layer. Figure 20 shows the image.
Figure 20: Image After the Mask is Added to the Shadow Layer
Obviously, Figure 20 doesn't look all that appealing. Not to worry, in the last step, the image will be fine tuned.

Fine tune the image

It is important at this point to understand what has been created. The Background layer is the layer with which we started. It has good detail in the highlights, but the shadows are too dark and the overall contrast of the image is too great. The Shadow layer was deliberately created as a lighter version of the image in order to bring out the shadow detail. The key to getting a photo with good overall detail is the mask on the Shadow layer. This mask was created to have the tonal values inverted from the Background layer. Thus, this mask is light where the Background layer is dark and dark where Background layer is light. Consequently, the mask allows the lighter Shadow layer to show in the shadow areas (where the Background layer is dark), and allows the darker Background layer to show in the highlight areas (where the Background layer is light). In short, we get the shadow detail from the lighter Shadow layer and the highlight detail from the darker Background layer. The result is an image with detail in both the shadows and the highlights.

Figure 21: Opacity Adjustment on Layers Palette

There are two primary methods of fine tuning the image. The first method is to adjust the Opacity of the Shadow layer (see Figure 21). By moving the Opacity to 21% (for this particular image; other images will use different Opacity settings), the image is improved. Figures 22 and 23 show the original image vs. the reworked image with the Opacity of the Shadow layer set at 21%.

Figure 22: Original Image
Figure 23: Reworked Image with Shadow Layer Opacity Set at 21%
Figure 24: Channels Palette
This is an improvement. However, I would like to bring out the shadows in the lower right hand corner a little bit more. This can be done by increasing the Opacity. However, areas in the trees are already too light. Increasing the Opacity would make them even lighter. This is not acceptable. What I want to do is leave the lightest areas of the mask alone, but darken the darker parts somewhat. After this is done, I will increase the Opacity of the Shadow layer. All of this can be done with the second method of fine tuning.
Figure 25: Levels

The second method of fine tuning the mask involves editing the Contrast Channel. Going back to the Channels palette (see Figure 24) allows the Contrast channel to be selected. Levels can now be used to edit the Contrast channel by choosing Image/Adjustments/Levels. Figure 25 shows the Levels menu. Moving the black input slider inward darkens the darker parts of the mask but leaves the lighter parts relatively unaffected (this will darken the lighter tones in the reworked image a little bit). The White input slider and the middle input slider where also adjusted slightly to achieve the desired tonal balance in the Contrast channel.

Figures 26 shows the original Contrast channel, and Figure 27 shows the channel after the Levels adjustment.

The mask that is currently on the Shadow layer will need to be deleted and a new mask applied using the same procedure as before.

Figure 26: Original Contrast Channel
Figure 27: Contrast Channel after Levels Adjustment

Once the new mask is created, the Opacity is increased to 37% (on this particular image; other images will require different Opacity settings).

Figures 28 -- 30 compare the original image with the two reworked images. Figure 28 shows the original image. Figure 29 shows the image with the first mask. Figure 30 shows the image after the Contrast channel was modified with Levels and a new mask created. In these small, web images, the differences between the two images with the masks are subtle, but there is more detail in the shadows on the lower right hand side with the new mask. In a large print, the difference would be much more noticeable.

Figure 28: Original Image
Figure 29: Image with the First Mask
Figure 30: Image After the Contrast Channel was Modified with Levels and a New Mask Created

The work performed so far has been done only to handle the contrast of the image. Further editing is required for a finished image.

After additional editing, the final image was created and can be seen directly below.

Figure 31: San Juan Loop Trail

Hey, What if You're Not Using Raw

If you are not using raw, the only thing that changes is that the Shadow layer is created by duplicating the Background layer. This layer is then lightened by using Brightness/Contrast. This is done instead of using the raw converter.

Summary

Once mastered, this tool is simple, quick, and easy, but it can produce great results. It's a good tool to have in your toolbox.

Articles