Classroom in a Blog

How to Mask in After Effects: Shape and Pen Tool The Complete Guide

Written by Timothy Brauning | February 09, 2022

Learning about how to mask in After Effects is an essential part of any video editing workflow.

In this guide, we will talk about what masks are, show you how to use masking in After Effects to create stunning visual effects, and take a deep dive into the different settings of masks.

Table of Contents:

What is a Mask in After Effects?

Masking is the process of hiding or revealing parts of an image or video. A mask, in a nutshell, allows you to control the visibility of specific parts of a layer.

Masks are an incredibly powerful tool in Adobe After Effects CC. Using masks, you can cut out and combine elements, build easy and professional transitions, isolate objects in videos or photos, make shapes, among many more things

Masks in After Effects are an essential tool, and we highly recommend that you spend a bit of time learning as much as you can.

Use Code: BLOG10  At Checkout To Save 10% off our Online After Effects Courses
Act Quickly, This Discount Won’t Last Forever!

How to create a mask in Adobe After Effects

Masks are created by drawing a specific path on a layer inside the Composition panel in After Effects.

Before you start creating a mask, be sure to have a layer selected with an image; otherwise, you will create what is called a shape layer.

There are a few different ways to create masks in After Effects. In this tutorial, we will cover:

Using Shape Tools for Masks in After Effects

The shape tools allow you to create masks in basic shapes like circles, squares, and triangles. By selecting the mask tool and clicking on any shape or cycling through the shapes using the "Q" key on your keyboard, you can mask off a part of the frame.

After you have selected a shape, click and drag your mouse on the image, and it will create the shape for you in whichever direction you drag the shape from.

By pressing control or command on Mac, the shape will create from the center instead of from the sides.

By pressing and holding shift on your keyboard while drawing the shape, all sides will be drawn the same size.

Using the Pen Tool for Maks in After Effects

The pen tool is the most accurate way to mask an image. It allows you to draw any shape you want and can be used for detailed masking jobs.

If you use the pen tool to create the masks, you must be sure to create what's called a closed path to make a mask. A closed bath is a complete "shape" drawn with the pen tool. Leaving an open path will not allow you to create a mask.

By clicking on the pen tool or pressing the "G" button on your keyboard, you can simply draw your mask.

How do masks work in After Effects?

Now that you understand how to create a mask, it's time to learn how masks work in After Effects.

Masks are made up of two parts- the mask and the fill. The mask controls what is visible, and the fill determines what color or image is used to "fill in" the mask.

By default, when you create a mask, the mask is set to "inverted." This means that whatever you mask off or inside the shape will be visible, and anything that is not masked will be hidden.

To change the mask from inverted to normal, simply press "M" on your keyboard to reveal the mask settings in your timeline and select the invert checkmark. You can also change the mode to subtract. We will touch more on that below.

Now that you have pressed the "M" key to reveal the mask settings let us look into the settings deeper.

Mode Mask Setting

This setting will determine what the mask will do.

  • The "None" setting will show you the entire image but leave the mask intact.
  • The "Add" setting will only show you what's in the mask shape.
  • The "Subtract" setting will only show you what is outside the mask. The "Subtract" setting is like the "invert" setting we applied above.
  • The "Intersect" setting will only show you what is inside of two intersecting masks.

There are a few other settings; however, getting comfortable with these will suffice for this introductory tutorial on masks in After Effects!

If you want to apply one of these settings to a mask as you draw them, you can press the below button before releasing the mouse.

  • "N" for "None
  • "A" for "Add"
  • "S" for "Subtract"
  • "I" for "Intersect"

You can also move your masks around. Like other programs such as Photoshop, Illustrator,  and Premiere Pro, the order in which your masks are stacked is important.

Be sure to right-click and rename your masks to know what they are. This will help for speed when editing and organization throughout your project.

Be sure to play around with masks and the different modes, so you have a better understanding of them!

Mask Path

The mask path setting lets you change the sides of the path, depending on the type of shape the mask was set to.

This setting will also allow you to animate your path. This we cover further down the article.

Mask Feather

The mask feather setting is found in the mask settings and allows you to soften or harden the mask around its edges.

Feathering a mask is measured in pixels and centered around the edges, or path, of the mask. If you increase a mask feathering 200 pixels, it will feather 100 pixels on the outside and 100 on the outside of the edges of the mask.

There is also a mask feather tool that you can use to change the feathering anywhere on the images that you are adding the mask to. You can select where the pen tool is or by switching the pen tool by pressing the "G" key until you see a feather pen.

Mask Opacity

The mask opacity setting determines how transparent the mask is. This can be useful to make sure that your mask blends well with your image or if you are trying to create a blend between two separate images.

Mask Expansion

The mask expansion setting can be used to add padding around your mask. In other words, it will allow you to either make the mask smaller or bigger without having to change the mask.

Working With Ae Masks

Now that you have all the masking basics under your belt, it's time to start masking in After Effects. Let's get into a few different masking examples and practice our masking skills together!

Moving a mask in After Effects

To move a mask on After Effects, choose the selection tool by pressing (V), then click-drag the squares in the corners of the mask itself.

Changing the mask shape

To change the shape of the mask's path, or rotate the mask, simply double-click the outer edges of the mask.

Double-clicking outside of the mask will un-select that setting. This will allow you to move and change single points instead of the whole mask at one time.

To manipulate more than one point at a time, you can press shift and click each point you want to change, then drag any selected points.

Alternatively, if you want to change two points next to each other, you can click and drag the path between the two points, or you can also create a box around multiple points that you want to change.

How to animate a mask in After Effects

To animate a mask in After Effects, you must create keyframes for the mask path.

To create a keyframe, select the mask path setting in the timeline. This looks like a small stopwatch to the left of the math path setting. This will activate the keyframe for that position in time.

Move the time stamp forward to create an ending keyframe, then change the mask shape, and that's it! 

You have officially animated your very first After Effects mask!

Mask animation is a common method of creating a “reveal” or transition throughout your project. Now that you learned the basics, we are excited to see what you can come up with by using masks in your next video.

Conclusion

Looking for a more in-depth overview? Consider our upcoming online After Effects classes! 

More After Effects Blogs