When you select a part of an image, the remaining area is "masked" or protected from editing. By creating a mask, you isolate an area of an image and protect it from applying color changes, filters, or other effects. The Masks are used for complex image editing such as gradually applied color changes or filter effects.
The Mask mode is needed for creating and editing selections of a sophisticated shape. To enter the Mask mode, press the button in the lower left corner of the Channels Panel.
In this mode, the current selection transforms to a new layer (a mask) in which you can apply the tools in the same way you would apply them on a regular layer. Instead of the Channels Panel, the Mask Panel will appear.
After pressing the button for exiting the Mask Mode, the mask becomes a regular selection again.
An example of working with the Mask Mode is given below:
1. Using any selection tool, select the part of the image that you want to change.
2. Click on the Mask Mode button in the Channels Panel.
The area outside of the selection becomes overlaid and no longer available for editing. The selected area remains available for editing. By default, the Mask Mode colors the protected area with a red overlay.
3. To edit the mask, select a drawing tool from the Tools panel.
4. Draw with white to select a larger area of an image (the overlay will be removed from the areas painted with white). To de-select areas, draw over them with black (the overlay will cover the areas painted with black). Drawing with gray or another color creates a semitransparent area, which can be used for dealing with blur or antialiasing effects. (Semitransparent areas may not appear selected when you exit the Mask Mode, but, in fact, they are.)
5. Exit the Mask Mode to return to the original image.