You can use masks to hide portions of a layer and reveal portions of the layers below. You can create two types of masks:
Layer masks are resolution-dependent bitmap images that are edited with the painting or selection tools.
Vector masks are resolution independent and are created with a pen or shape tool.
Layer and vector masks are nondestructive, which means you can go back and reāedit the masks later without losing the pixels they hide.
In the Layers palette, both the layer and vector masks appear as an additional thumbnail to the right of the layer thumbnail. For the layer mask, this thumbnail represents the grayscale channel that is created when you add the layer mask. The vector mask thumbnail represents a path that clips out the contents of the layer.
You can edit a layer mask to add or subtract from the masked region. A layer mask is a grayscale image, so areas you paint in black are hidden, areas you paint in white are visible, and areas you paint in shades of gray appear in various levels of transparency.
A vector mask creates a sharp-edged shape on a layer and is useful anytime you want to add a design element with clean, defined edges. After you create a layer with a vector mask, you can apply one or more layer styles to it, edit them if needed, and instantly have a usable button, panel, or other web-design element.