White areas on a Layer Mask are transparent and black areas hide that part of the image completely. Grey areas partially hide the image.
New layer masks are created white, which means they are transparent. Paint on them in black to hide parts of the image.
If you create a Layer Mask while a Selection is active, then the Selection will be applied to the Layer Mask in black.
You can paint on a Layer Mask in black or white while a Selection is active and the paint will only apply to the selected areas. Similarly you can add or subtract from an existing layer mask by doing this.
You can create a new layer mask in black by holding down the ALT key while it is created. Black masks show nothing of the image. Paint on in white to reveal parts of the image.
You can use all the destructive editing tools in Menu > Image > Adjustments to work on a mask as the non destructive Layer Masks are not available.
You can apply a layer mask to the image. The option is in the menu which appears by right clicking on the mask. The mask then disappears.
Regular layer masks show up in black and white and vector masks in grey.
Apply a Layer Mask is available by right clicking the Layer Mask. This reduces the size of the image to the size of the mask and removes the layer mask. Great for just selecting a small part of the image.
Apply Image can be applied to a Layer Mask by first selecting the mask and then Menu > Image > Apply Image. Any effect is then selectively applied to the lighter areas.
The Properties Window for a Layer Mask has some useful options with sliders for Density and Feather, as well as shortcut buttons to Select and Mask and Colour Range Tools.
Use CRTR + A on the mask to select all, then ALT + BACKSPACE will fill it with black.
CMD + I will invert a mask.
To copy a layer masks onto another mask use ALT + CLICK and drag it to the new position to copy it over.
ALT + Click opens the mask to view it and edit it and do this again to close it.
SHIFT + CLICK toggles a mask on and off. When it is off it has a red cross over it.
CMD + CLICK selects a mask and makes the selection live.
ALT + Create Layer Mask produces an inverted layer mask, which is black, so nothing shows through.
Q to enter Quickmask Mode which shows unmasked areas in red. Paint black to add more red mask and white to delete it.
Editing Layer Masks and Channels
Layer Masks and Channels are just images that happen to consist of only black, white and shades of grey, and can be edited with many of the tools that other images can be edited with.
The Levels Adjustment is usually the most suitable tool to edit the mask with, as you can control the white, black and mid-grey points with sliders to increase contrast.
Clean up a mask using a brush in Overlay Blending Mode. If you paint with black it will selectively paint over the dark grey areas making them blacker and not touch the light greys or white areas. Similarly painting white over the light grey areas makes them whiter without affecting the dark greys and black. Hence you do not need to be particularly selective in where you paint.