Know the Basics: After Effects Part 6: Masking

Today we're going to take a look at how we can use the technique of masking to customise what can be seen of our footage at any one time.

Previous tutorials

Know the Basics: After Effects Part 1: Interface
Know the Basics: After Effects Part 2: Timeline
Know the Basics: After Effects Part 3: Effects
Know the Basics: After Effects Part 4: Titles
Know the Basics: After Effects Part 5: Animation

Masking is a vital part of any post-production work flow, whether that be still images in a program like Photoshop or moving images in After Effects. Knowing how to utilise masks will enable you to edit your footage and titles in ways that will take your videos from the realm of amateur the world of professional. There are a couple of primary techniques for masking and we'll look at them both.

Step 1: What is masking?

Masking is where we can utilise a greyscale image to determine which parts of the layer below are visible or invisible. Parts of the layer can be partly visible if the value in the mask is something other than black or white. Masks are so unbelievably useful that you'll be using them all the time once you get to grips with them.

Use masks to make adjustments to only select parts of your image.

Use masks to make adjustments to only select parts of your image.

Step 2: Shape tools for masking

The easiest way to create a mask is to use the shape tool. This can be found on the top tool bar. There are 5 types of shape which can be accessed by clicking and holding down on the tool. With your chosen one selected and your layer selected simply click and drag to set the size of your shape. You'll notice that your image is now only visible in the area represented by the shape.

Shape tools are a quick and easy way of creating masks for your layers.

Step 3: Animating your mask as a whole

Select your layer and hit 'M'. This will bring up the property called 'Mask Path'. We can key frame this property so that the path changes over time. Do this by using the 'Selection Tool' and creating two key frames at different points in time. At one of those key frames simply drag the mask in the composition window and see the whole shape move.

Animate the whole mask in one by key framing it.

Animate the whole mask in one by key framing it.

Step 4: Animating your mask points

Quite often you'll want to only animate specific points inside the mask. You can do this by selecting only an individual vertex and key framing the movement of that. This is useful if you need your mask to behave in a specific way that can't be achieved by moving the whole thing.

Animate the individual points of the mask without affecting the whole.

Animate the individual points of the mask without affecting the whole.

Step 5: Layering masks

You can layer masks on top of each other by following step 2. If you go to the properties of each mask in the timeline then you'll notice a dropdown box which by default is set to 'Add'. This determines how the masks will overlay on top of each other. There are a number of options which let you get exactly what you want.

Layer masks to create more complex masks.

Layer masks to create more complex masks.

Step 6: Mask track mats part 1

The second way to create masks in After Effects is to use something called a track mat. Rather than applying the mask directly onto the layer like we did with shapes, this technique utilises a separate layer which the masked layer references to determine what part of it should be visible. To create this, simply create a new solid from the 'Layer' menu or you could also import a grayscale image to achieve the same purpose. The mask could also be a footage sequence where the mask changes over time.

Use mask track mats to adjust what is visible on the layer below it.

Use mask track mats to adjust what is visible on the layer below it.

Step 7: Mask track mats part 2

In the timeline for each layer there will be a 'TrkMat' column. If it's not there you may need to hit the 'Toggle Switches/Modes' button at the bottom of the timeline. Navigate to the layer directly underneath your mask and set the track mat to one of the four options. The right options depends on whether you want to use the alpha or luma values of the mask.

Use mask track mats to adjust what is visible on the layer below it.

Use mask track mats to adjust what is visible on the layer below it.

Step 8: Animating a track mat

Animating a track mat is slightly different to animating a shape mask. You need to track the mask layer as a whole. So you could animate the position of the layer so that they greyscale values move around the screen, or you could do the same thing for the scale property. This sort of technique is really useful for making text appear in a wipe fashion.

Use track mats to mask an underlying layer.

Use track mats to mask an underlying layer.

Step 9: Using one track mat for multiple layers

A track mat always affects the layer directly below it. Therefore if you want to use the same track mat for multiple layers then you will need to pre-compose all those layers but not including the mask layer. That pre-composition layer will then reference the single track mat.

Pre-compose your layers to utilise one track mat for a whole pre-composition.

Pre-compose your layers to utilise one track mat for a whole pre-composition.

Step 10: Mask shortcuts

There are tonnes of really useful shortcuts for After Effects and masks are no exception. The most used shortcut for me personally with regards to masks is to select the layer in the timeline and hit 'M'. This will bring up all the masks you have for that layer. You can hit 'M' multiple times to cycle through different levels of visibility of the properties.

Use shortcuts to speed up your workflow.

Top tip: Occlusion objects

A brilliant, although maybe overused, application for masks is to have text appearing from behind an object in your footage. This can be done by animating your mask over time so that it follows your object.

Use animated masks so that they act as occlusion objects.

Use animated masks so that they act as occlusion objects.

Related links

For more from Paul Hatton, check out C A Design Services
Download After Effects
Check out Video Copilot for plug-ins
Find some useful scripts for After Effects
Know the Basics: After Effects Part 1: Interface
Know the Basics: After Effects Part 2: Timeline
Know the Basics: After Effects Part 3: Effects
Know the Basics: After Effects Part 4: Titles
Know the Basics: After Effects Part 5: Animation

Fetching comments...

Post a comment