In my own retouching work and in previous tutorial-articles here, masking is an integral part of the workflow. To maintain maximum flexibility, masking is essential, and to make the process as convenient as the Eraser tool, you'll need to know how to work with masks quickly. Here, we'll examine a variety of shortcuts to help you work with a variety of different masking features and techniques.
Erasing sets opacity to 0 with no way to get it back'"it's just gone, and there's no 'unerase' tool. Masking though, can set opacity to any value you choose'"erasing or restoring'"by painting with black, white, or any shade of grey. Areas with a white mask are visible, areas with a black mask are invisible, and grey areas bridge the gap.
For maximum flexibility, never use the Eraser Tool
One of the most basic ways to utilize masking is to use Quick Mask, which lets you paint to change the active selection.
Press Q to enter Quick Mask mode. Selections turn into a red overlay, called a rubylith, that show selected or masked areas. After painting, press Q again to leave Quick Mask mode, and your selection will have changed. Very useful, and a vital bridge between selections and Layer Masks.
A selection, turned into a Quick Mask shown in two ways
The default Quick Mask behavior is to show the masked (i.e. unselected) areas in red. I prefer the opposite: to show my selections in red. To change the setting, double-click the Quick Mask button at the bottom of the tool panel, and choose Selected Areas from the dialog that appears. You can also change the color of the rubylith here, handy for selecting red objects.
My preferred Quick Mask setup, painting selections not masks
Once you've painted a selection with Quick Mask, how can you preserve it as a Layer Mask, to hide part of a layer?
The quickest way to create a Layer Mask varies. If no Layer Mask is present, you can click the third icon from the left in the Layers panel (the circle inside a rectangle). If this layer already has a Layer Mask, don't press it again: you'll get a Vector Mask as well.
The Add Layer Mask button
If a selection is active, that selection will be copied to the Layer Mask. That is, the mask will be white (and the layer visible) where selected fully, black (layer is invisible) where deselected fully, and grey between. Holding Option while clicking the Layer Mask button reverses this, hiding the selected areas.
With no selection, an all-white layer mask is created, revealing it all. However, Option-clicking that button with no selection creates an all-black Layer Mask, hiding the layer entirely.
Using the menus reveals more: Layer > Layer Mask has five options, covering the Reveal All, Hide All, Reveal Selection, Hide Selection, and the new one, From Transparency. This option converts a layer with transparent edges into a flattened layer with a layer mask, and works well.
For any of these functions, if you'd prefer to use shortcut keys, you can define your own with Edit > Keyboard Shortcuts.
Never use the eraser again! Instead of pressing E for the Eraser on a layer, just switch to its Layer Mask, then press B to access the brush tool, D to set default colors, and X to exchange foreground and background colors. You also might prefer to start from scratch: use Option-delete to fill with the foreground color, or Command-delete to fill with the background color.
To switch quickly between painting on a layer mask and painting on the layer itself, use Command-\ (backslash) to select the layer mask, or Command-2 to select the layer. However, these commands don't affect visibility. To see the layer mask overlaid on the layer as a rubylith (like a Quick Mask) use \ (backslash). Should you want to see the unmasked layer, just Shift-click on the Layer Mask thumbnail in the Layers panel and it will be disabled.
A layer mask after being disabled by Shift-clicking
Normally, the quick way to load an existing channel, selection or mask as a selection is to Command-click it. This is a vital shortcut, as it lets you access existing image data to use as a starting point for further masking or selection-building. But if it's a Layer Mask you need to copy, you could also press Command-Option-Shift-\ (backslash) while the layer is selected.
After Command-clicking the Red channel, in the Channel panel
To apply that selection onto a mask that already exists, just use the Option-delete or Command-delete fill commands noted above. And if something is flipped? Invert the selection with Command-Shift-I, or invert the mask with Command-I. Phew!
It's not always the best idea to duplicate your existing layer masks. Sometimes, the best way forward is to reuse a single layer mask to govern the visibility of multiple layers at once. In a future article, we'll explore the world of clipping masks, which let you do just that.