#22. Using Layer MasksIf you're making a selection to delete contents from a layer, consider converting the selection to a layer mask instead of permanently discarding it. A layer mask usually starts as a selection that is linked to a layer. The selection acts as a cutout or frame for which only part of the layer's contents show through. The effect is identical to deleting the contents of a layer, but layer masks afford you the freedom to change your mind since the underlying image remains intact. You can always go back and edit the mask.
It's easy to create a layer mask. Make a selection of what you would like to keep visible on a layer (except the Background layer). Click the Add Layer Mask button Figure 22a. After you create a layer mask on a selected layer, a mask thumbnail appears linked next to the layer thumbnail. To view just the layer mask, Option/Alt-click the layer mask thumbnail. While in this mode you can edit the layer mask just like any other grayscale image. Areas you paint in white are visible, black are transparent, and anything gray translates into varying levels of transparency (Figure 22b). When you're through, click the layer thumbnail to see the effects of the layer mask. If you want to continue editing the layer mask while viewing its effect on the layer, just click the layer mask thumbnail (without the Option/Alt key). If you'd like to move the position of the mask independent of the layer, click the link icon Figure 22b. You can opt to view just the layer mask as you work on it, switch to the layer to see the effects of the mask, or temporarily disable the layer mask to see the layer's actual contents.![]()
Layer masks are great when you want to use pixels to define your transparent areas, but if you want a hard-edged layer mask with the flexibility of using vector-based tools, you'll want to create a vector mask. You can make a vector mask by creating a work path outline using the Pen or Shape tools. Before you start creating your path, select the Pen or Shape tool and then click the Paths button Figure 22c. A layer can have a layer mask and a vector mask applied to it at the same time. |