A layer mask prevents sections of a layer, or an entire layer, from being visible. You use the mask to show or hide sections of an image or an effect. When the layer mask (right thumbnail) attached to an adjustment layer is completely white, the adjustment effect is applied to all underlying layers. If you don’t want to apply the effect to certain portions of the underlying layers, paint the corresponding area of the mask with black. When attached to a fill layer, the mask defines the filled‑in area in the fill layer.
To view only the mask, Option-click the Layer Mask’s thumbnail (the rightmost thumbnail). Option-click the thumbnail again to redisplay the other layers.
To view the mask in a red masking color, hold down Option+Shift and click the Layer Mask’s thumbnail (the rightmost thumbnail). Hold down Option+Shift and click the thumbnail again to turn off the red display.
To constrain editing to part of the mask, select the corresponding pixels.
To remove areas of the adjustment effect or fill, paint the layer mask with black.
To add areas to the adjustment effect or fill, paint the layer mask with white.
To partially remove the adjustment effect or fill so that it shows in various levels of transparency, paint the layer mask with gray. (Single-click the foreground color swatch in the toolbox to choose a gray shade from the Swatches palette.) The extent to which the effect or fill is removed depends on the tones of gray you use to paint. Darker shades result in more transparency; lighter shades in more opacity.