Masks are grayscale raster layers that cover parts of the layers in your image, either completely or with varying levels of opacity. You can use masks to fade between layers, or to create special effects with precision. For example, you can mask the details around the main subject in a photo, or you can use a mask to create a fading navigation bar for a Web page.
Mask pixels display 256 shades of gray, with each shade corresponding to levels of opacity. White pixels show underlying layers, black pixels hide underlying layers, and gray pixels show varying amounts of underlying layers.
Mask layers cannot be the bottom layer in the image or in a layer group. If the mask layer is at the main level (rather than in a layer group), the mask applies to all layers below it in the stacking order. If a mask layer is in a layer group, it applies only to layers within the group that are lower in the stacking order.