Layer Masking in Photoshop CS4
Lesson files for this excerpt can be found here.
When working in Photoshop, you’ll often need to combine multiple images together into a new composite image. Those original images, however, may have backgrounds or objects that you no longer want. This is where Layer Masks come in. Far superior to erasing pixels, Layer Masks allow you to hide (or mask) part of a layer using powerful painting and selection tools. The more you work on combining multiple images, the more you’ll find yourself using masks.
Layer Mask Essentials
In this chapter, you’ll revisit several techniques that you learned in Chapter 5, “Selection Tools and Techniques.” Masks generally start as a selection, which is then attached to a layer. The mask can be refined by adding to it with black or subtracting with white. Learning to create and modify masks is an important skill that becomes significantly easier with a little practice.
Adding Layer Masks
The best way to learn about Layer Masks is to jump right in and create one. You’ll start with an easy image, but one that will help illustrate the important concepts. Let’s get started:
- Open the file Ch07_Mask_Start.tif from the Chapter 7 folder on the book’s CD.
- Convert the Background layer into a floating layer by double-clicking its name in the Layers panel. Name the layer Tower.
- Select the Quick Selection tool from the Tools panel.
- Make a selection of the blue sky.
- Reverse the selection by choosing Select > Inverse. The building is now selected.
- Click the Add layer mask button to add a mask to the layer.
- To make it easier to see the edges of the border, place a solid color layer behind the Sundial layer. Choose Layer > New Fill Layer > Solid Color. Choose a color that is not in the image, such as green.
- Drag the fill layer below the Sundial layer in the Layers panel.
- Depending on the accuracy of your initial selection, your mask may be usable as is. If needed, you can quickly touch it up using the Brush tool.
- Click the Layer Mask thumbnail to select it.
- Activate the Brush tool by pressing B or by choosing it from the Tools panel.
- Press D to load the default colors of black and white. Black will add to a mask and create transparency; white will subtract from the mask. Using gray or blurring will create a softer edge.
- Zoom in to better see your edges. You can use the Zoom tool or the Navigator panel to get a better look at your edges.
- Paint with a soft-edged brush to refine the mask. If you add too much to the mask, press X to toggle the mask colors. Remember, painting with black will add to the mask (hence removing or masking the image).
- You can improve the edges of the mask by using the Blur tool or the Smudge tool on the edges. You can stop tweaking when you are satisfied with your results.
Disabling Layer Masks
The primary benefit of masks is their flexibility. In the previous section you explored that flexibility by adding and subtracting to a mask. This flexibility can also be used to temporarily disable a mask. This can be useful if you want to check your progress or if you need to restore the original image to use on another project:
- Work with the Tower image from the previous exercise or open the file Ch07_Mask_End.tif from the Chapter 7 folder.
- Select the Layers panel so it is active.
- Shift-click the Layer Mask thumbnail to disable it. Alternately, you can right-click the mask’s thumbnail to access more options, such as deleting it and permanently applying it.
- To re-enable the mask, Shift-click its thumbnail again.
Deleting Layer Masks
After going through the effort of creating a mask, you are unlikely to want to permanently discard it. But if you change your mind and are certain you want to delete it, doing so is easy:
- Work with the Tower image from the previous exercise or open the file Ch07_Mask_End.tif from the Chapter 7 folder.
- Select the Layers panel so it is active.
- Click the Layer Mask thumbnail. Drag it to the trash icon in the Layers panel.
- A dialog window appears asking you to decide what to do with the mask:
-
Delete: Discards the mask and restores the image to its premasked state.
-
Cancel: Allows you to cancel the command and return the image to its masked state.
-
Apply: Permanently applies the mask and deletes the pixels that were originally masked.
- Click Apply to permanently apply the mask. The mask is used to permanently discard portions of the masked layer in a destructive edit.
Using Vector Masks
Most users choose to work with the raster-based Layer Masks previously discussed. These raster-based masks tend to be the easiest to work with and allow the most flexibility in editing due to the wide variety of tools you can use to modify the mask. However, some users prefer to work with vector tools like the Pen tool or the Shape tools because of personal preference (or more experience with programs like Adobe Illustrator). There are several ways to add a Vector Mask:
- After you’ve added a raster Layer Mask, click the Add layer mask button in the Layers panel to add a second mask that is vector-based.
- To add a Vector Mask initially, Command/Ctrl-click the Add layer mask button when adding the first mask.
- To add a new (empty) Vector Mask, you can choose Layer > Vector Mask > Reveal All.
- To hide an entire layer, choose Layer > Vector Mask > Hide All.