Layer masks allow you to show or hide certain parts of a layer without actually having to modify the layer itself. This can be tremendously helpful when working with layers without committing to permanent modification.
Creating a Layer Mask
Select the layer that you would like to add on a layer mask. At the bottom of the layers list, click on the cogwheel and select "Add Layer Mask". You can also control-click on the layer to bring up the canvas contextual menu, or choose Layer ▸ Add Layer Mask.
The mask shows up to the right on the layer as you can see highlighted on the image to the right.
Working with Layer Masks
In layer masks, black that is drawn or painted on the mask hides pixels in the linked layer thus exposing the layer below in those areas. In this example the bird layer has the layer mask, and the lion is in the layer below. By selecting a brush and the color black, the bird's background can appear to be removed by drawing on the layer mask.
White does the opposite of black in layer masks. Anything drawn or painted in white on the layer mask will preserve that area of the linked layer. If you feel like you have exposed too much of the layer below, you can correct this by changing the color of your pen or brush to white, and draw on the layer mask until you have achieved your desired effect. Play around with the opacity and style of your pen or brush to maximize smoothness between your layers.
To edit and see your work on the layer mask directly option click on the layer mask thumbnail. Option click on the thumbnail again to return to the full layer view.
Moving, Disabling, and Deleting Layer Masks
To move a layer around on the canvas without also moving the layer mask, click on the "+" that is located between the layer and layer mask in the layers list. Re-clicking in this location will cause the "+" to appear again and allow the layer mask to move with its layer in the canvas.
Disabling a layer mask allows you to see what things look like in your project without the layer mask present. You can disable a layer mask by right clicking on the layer to bring up the contextual menu and selecting "Disable Layer Mask". The layer mask will turn dark gray to show that it is disabled. The layer mask can be turned on again by selecting "Enable Layer Mask" from the contextual menu.
To delete a layer mask, make sure you have the mask selected. Then you can right click on the layer and select "Delete Layer Mask". Another way to accomplish this is to click on the cogwheel at the bottom of the layers list and the option to delete the layer mask will be presented.
Vector Shapes and Layer Masks
Currently layer masks are bitmap only, which means you cannot draw shapes in them. If you would like a shape in a layer mask, there is a work around you can perform as outlined in the Shapes in Layer Masks tutorial.