Working with masks

Deke McClelland
www.deke.com
- Created:
- 15 Oct 2008
- User Level:
- Intermediate, Advanced
- Products:
- Photoshop CS4 or later
Add and edit filter masks, layer masks, and vector masks in the Masks panel. Learn how to easily change the density and feathering to refine a mask's edges.
Requirements
To complete the tasks demonstrated in this tutorial, you need the following software and files:
Adobe Photoshop CS4
Sample files
lrvid4003_ps.zip (ZIP, 8MB)
Prerequisite knowledge
Intermediate knowledge of creating and editing masks in Photoshop
Working with masks
Density and Feather are two new options you can use to affect a sharp-edged, vector-based mask. To use Density and Feather:
- Open a file in Photoshop.
- Choose the Polygon tool from the Photoshop toolbox.
- In the Options bar at the top of the document window, click the arrow next to the Polygon icon to reveal the Polygon Options menu. Select Five-point White Star and click on the gray pasteboard area to close the menu. Drag to draw a star over your image.
- Click the fill color box in the Options bar and select a yellow hue from the color picker. Notice that the Layers panel contains a new layer: a field of yellow constrained by a star-shaped vector mask.

Figure 1: Adding a star-shaped vector mask
Note: While vector masks are normally associated with sharp edges, you can change this characteristic by adjusting the Feather value. Feathering creates soft, blurred edges by combining the colors on either side of the border of the selected object.
- To increase the feather, move the Feather slider in the Masks panel to the right. To decrease the feather, move the slider to the left. The Masks panel is located just below the panels for Color, Swatches, and Style and next to the Adjustments panel in the default Photoshop workspace.

Figure 2: Adjusting the Feather value
- Move the Feather slider to the right. You should notice that the yellow fill of your star has become blurred around the edges.
- You can also reduce the strength of the mask by decreasing the Density value. At 100% density, Photoshop restricts the fill color just to the areas defined by the polygon mask. When the density is reduced, the strength of the mask is reduced and color will seep into the other areas of the image. To decrease the density value, move the Density slider to the left. Notice that the entire image starts to acquire a yellow tint.

Figure 3: Reducing the Density
Note: Both the Density and Feather options are "smart," or editable, nondestructive editing techniques. Meaning once you have applied changes to the Density and Feather values, you can return these values to their original settings or alter them as needed. Also note if you modify your shape, the Density and Feather settings aren't affected.
- Choose the Direct Selection tool. Press the Shift key and click to select the anchor point on every other point in your star.

Figure 4: Reducing the Density
- Press Command/Ctrl+T to free transform the star. Notice a bounding box appears around the selected anchor points. Reduce the size of the selected star points by pressing Alt/Option and dragging inward from one of the selected anchors.
- Double-click the star to commit the changes and exit Free Transform mode. Note that Photoshop has not updated the feather and density properties of the image.
Adjusting the highlights of an image
You can adjust the highlights of an image using the new Adjustments panel. To use the Adjustments panel:
- Click the vector mask thumbnail, and then press the Delete key to remove the entire layer.

Figure 5: Deleting a layer
- Click the Adjustments tab.
- On the Adjustments panel, click the Curves icon to create a curves adjustment layer.

Figure 6: Making a curves adjustment
- Click the Toggle Onscreen Selector, located in the upper-left corner of the Adjustment panel, as shown in Figure 7.

Figure 7: Using the Toggle Onscreen Selector
- Identify a highlighted area in the image and drag down to reduce the highlights in the image. Note that the hand icon becomes an eyedropper when you are not dragging in the image.
- Find a representative midtone in the image and drag upward to brighten midtones. You should now have two points on your curves adjustment graph in the Adjustments panel.
- Press the Plus key—a new keyboard shortcut in Photoshop CS4—to toggle to the next point along the curve in your graph. Drag the selected point to the left to decrease the Input value.
- Switch to the second point by pressing the – (minus) key. You can switch between points by using the + and – keys indefinitely. Move the second point along the graph to the right to increase the Input value.
The Color Range command
You can protect the midtones and shadows and isolate the highlights, or vice versa, by masking the Curves adjustment using the Color Range command. To use the Color Range command:
- Make the Masks panel active, and then click Color Range. The Color Range dialog box opens.

Figure 8: The Color Range command
- Shift-click some of the highlights in the image to add them to the mask. Notice these areas appear in the preview window in the Color Range dialog box.
- Localize colors to a certain region of the image by choosing Localized Color Clusters.
- Adjust the Range value to focus in on an area near your click points. You can enter a value between 0 and 100 directly in the Range box or move the slider to the left or right. This will add a radial gradient to the mask, which you can see in the preview window. The greater the range value, the larger the area of the image you are able to sample.
- Click OK to accept the modifications. You have now added a mask to your adjustment layer. Notice that the mask only affects the highlights in the image.

Figure 9: Adding a mask to an adjustment layer
Blurring the background
Blurring the background is one way to create an exaggerated depth-of-field effect. To apply a blur effect:
- Switch to the background by selecting the background layer in the Layers panel.

Figure 10: Selecting the Background layer
- Navigate to the pop-up menu in the Layers panel and choose Duplicate Layer to make a copy of the background layer. Name the duplicate layer Blur.
- Click the Channels palette. Load the basic alpha channel by clicking the Quick Selection layer or pressing Command/Ctrl+6.
- Load the alpha channel as a selection outline by Command/Ctrl-clicking the Quick Selection layer.
- Return to the Layers panel. Apply the alpha channel as a mask to the Blur layer by clicking the Add Vector Mask icon at the bottom of the Layers panel.

Figure 11: Adding a layer mask
- Click on the Blur layer to select the image and the mask and choose Filter< Blur > Gaussian Blur. The Gaussian Blur dialog box opens. Move the slider to the right to increase the blur radius. Notice that the blur effect is constrained to the alpha channel mask you created of the foreground subject, rather than the background.

Figure 12: Applying a blurring effect
- In order to shift a blur effect from the foreground to the background, you need to invert the layer mask. To invert the layer mask, choose the Blur layer mask from the Layers panel. Then, open the Masks panel and click Invert.

Figure 13: Constraining the blur effect to the background
Using the Mask Edge feature
You can also eliminate any haloing effect around your image by using the Mask Edge feature. To use the Mask Edge feature:
- Select the layer mask in the Layers panel. Then, in the Masks panel, click Mask Edge to open the Refine Mask dialog box. Use the Radius, Contrast, Smooth, and Contract/Expand options to affect the boundaries of your mask. Decreasing the Radius, increasing Contrast, and Contracting the mask all reduce blurriness or halos around the edges of your mask.

Figure 14: Using the Mask Edge feature
- Click OK to save your changes. You have applied a permanent modification to the layer mask, but the haloing effect has disappeared.
Where to go from here

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License
About the authors
In 1985, Deke McClelland oversaw the implementation of the first personal computer-based production department in Boulder, Colorado. In 1986, he became the artistic director for Publishing Resources, one of the earliest all-PostScript service bureaus in the United States. Deke McClelland is a well-known expert and lecturer on Adobe Photoshop, Illustrator, InDesign, and the broader realm of computer graphics and design. To date, he has written 85 books that have been translated into 24 languages, with more than 4 million copies in print.