A layer mask is represented in the Layers palette as a rectangle with a black background and the shape of the selection in white or gray. Layer masks can be used to hide or reveal entire layers or selections on layers. The black part of the layer mask (in the mask’s thumbnail in the Layers palette) is hidden.
To create a Layer mask that hides or reveals an entire layer:
1. Make sure no selection is currently active, and select the layer to mask in the Layers palette.
2. Choose Layer>Add Layer Mask>Reveal All to reveal the entire layer or Layer>Add Layer Mask>Hide All to hide the entire layer.
To create a layer mask that hides or reveals a selection only:
3. Select the layer you add the mask to in the Layers palette.
4. Make the selection for the mask using a selection tool.
5. Choose Layer>Add Layer Mask and either Reveal Selection or Hide Selection. Only the selection will be hidden or shown, and this selection can be edited independently of the other parts of the image.
To work with layer masks that have been created:
6. Select the layer in the Layers palette that contains the mask you wish to edit. Click once on the layer mask thumbnail to make it active.
7. Select an editing or painting tool.
8. Paint with white to subtract from the image, black to add to it, and gray to partially hide the layer. You can switch to using the foreground and background colors in the toolbox and revert to the original black and white there too.
9. When complete, you can either apply or discard the mask by holding down the Shift key and clicking once on the mask in the Layers palette. A red X indicates that the mask is discarded.
Using layer masks allows you to separate and control specific parts of an image by producing a stencil of a selection. This stencil can be altered but the area around it is protected from change. These selections can then be saved for later use by saving the mask in an alpha channel. This is briefly detailed next.