In image editing, masks nondestructively hide parts of layers. There are lots of different uses for masks and they are an incredibly flexible and powerful image editing tool. For example, in photo editing, you might use masks to combine parts of different photos into one. In graphic design, you might use clipping masks to fit an image within a container. And, in illustrations, you might use masks to fill layers with textures. Let’s check out how masks work and how to use them.
Essentially, layer masks ‘erase’ parts of layers so they are no longer visible. Why not use the Erase tool, then? There are a few reasons — for one, once you erase an area, you need to go back and undo every change to get the original image back. It may also not be possible to erase certain layers (text, shapes, and RAW layers). Masks let you nondestructively hide parts of layers of every type — including layer groups. And you can remove or refine the masks whenever you want in order to make the original image fully visible. Not just that, masks can also be copied from layer to layer and edited using effects, making them infinitely more versatile for many image editing tasks.
In Pixelmator Pro, there are two kinds of masks — layer masks and clipping masks. Let’s start with layer masks.
To add a layer mask, Control-click a layer in the Layers sidebar and choose Add Mask. You could also select the layer you’d like to mask and choose Format > Mask > Add Mask (from the Format menu at the top of your screen).
Notice how a white thumbnail appears next to the layer. Layer masks work in black and white (otherwise known as greyscale). When you first add a mask, it’s completely white by default. In layer masks, the color white doesn’t hide anything, so a completely white mask will have no effect on the image. Any part of a mask that is pure black will completely hide that area of the layer to which it is applied.
To begin editing your mask, you’ll first need to click the thumbnail to select the mask.
You can use almost any tool in Pixelmator Pro to edit masks, just like you would edit any other type of layer. But to mask out photos, the Paint tool is often used, so let’s start with that.
Once you’ve added a mask, choose the Paint tool (B) and select a basic round brush. Remember, we’ll need the colors black and white and to reset the primary and secondary colors in Pixelmator Pro to black and white, you can press the D key. The color black will be selected by default.
Useful Keyboard Shortcuts
When editing layer masks, there are three very useful keyboard shortcuts to remember: B, D, and X. The B key selects the Paint tool so you can choose a brush with which to edit the mask. The D key resets the primary and secondary colors in Pixelmator Pro to black and white. And the X key switches between those two colors.
With the layer mask still selected, paint over your image. The areas you paint over will be nondestructively erased and, if you have other layers underneath, they will start showing through. If you’d like, you can also experiment with shades of grey (or adjust the Opacity of the brush) to make areas partially visible.
Invert a Mask
You can use the Command-I keyboard shortcut to invert a mask from black to white, so instead of painting to hide areas, you could start with a black mask and paint with white to gradually reveal areas.
In Pixelmator Pro, there are more ways to create masks than just painting them in. For example, you can also create them from selections. If you have an object you’d like to mask, you can first make a selection of it using any of the selection tools. When you add a mask, everything outside the selected area will be hidden by the mask automatically created for you.
You can even use effects to create masks nondestructively. For example, you can create a mask from an image by applying the Image fill effect to a layer mask. Or use the Gradient fill effect to create a fade effect.
Clipping masks, like layer masks, are also used to mask out parts of objects. However, instead of painting on a dedicated mask layer, existing layers in your Pixelmator Pro documents act as the mask — for example, you can use text and shape layers as clipping masks. When you create a clipping mask, any transparent areas of the clipping mask layer will mask out those same areas of any layers ‘clipped’ to it. In simpler terms, if you create a clipping mask from a circle and clip a photo to it, any parts of the photo outside the circle will be hidden.
So, in order to create a clipping mask, you’ll need at least two layers — one layer to act as the mask, and another layer to be masked. Any layers at all will work, whether it’s some text, a shape, or even a layer group.
To create a clipping mask, Control-click the upper layer in the Layers sidebar and choose Create Clipping Mask. You can also select the upper layer and choose Format > Mask > Create Clipping Mask (from the Format menu at the top of your screen) or hold down the Option key and click the area between two layers.
Notice how the contents of the layer above are clipped to the shape of the layer below. You can choose the Move tool and resize both layers individually to change the mask or its contents. You can apply effects to either layer, too. And the great thing with clipping masks is that you can create them from any kind of layer. For example, if you add some text, you can clip an image to the text layer and edit the text whenever you want.
There are lots of different ways to use masks in image editing, but if you’d like to get a little bit more practice, try masking out the sky in one photo and replacing it with another or filling a text layer with an image using a clipping mask. And if you have any questions, feel free to post them below and we’ll do our best to help out!