User Guide Cancel

Create masks

You can create shapes and masks with the Rectangle and Pen tool in After Effects. When you create a mask or shape layer, keep the following things in mind:

  • If a layer is selected in the Timeline panel, you are creating a mask.
  • If a layer is not selected in the Timeline panel, you are creating a shape layer.
Note:

Shortcuts for the Shape tool is Q, and the Pen tool is G.

Create masks

You can create one or more masks for each layer in a composition using any of the following methods:

Draw a path using Shape or Pen tool. Drawing a mask path is similar to drawing a shape path.

Learn more about creating a shape or mask by dragging with shape tools and creating a Bezier shape or mask using the Pen tool.

Specify the dimensions of the mask path numerically in the Mask Shape dialog box.

Learn how to create a rectangular or elliptical mask numerically.

 

Convert a shape path to a mask path by copying the shape’s path to the Mask Path property.

 

Convert a motion path to a mask path.

Learn more about creating a mask or shape from a motion path.

Trace color or alpha channel values to create a mask using the Auto-trace command.

Learn more about creating a mask from a channel with Auto-trace.

Paste a path copied from another layer or from Adobe Illustrator or Photoshop.

Learn more about copying a path from Illustrator or Photoshop.

Convert a text layer to one or more editable masks on a solid-color layer by using the Create Masks From Text command.

Learn more about creating shapes or masks from text characters.

Use captured shapes to create motion graphics.

Learn more about using captured shapes to create motion graphics.

Points to keep in mind

  • When you create masks on a layer, the mask names appear in the Timeline panel outline in the order in which you create the masks. To organize and keep track of your masks, rename them.
  • To rename a mask, select it and press Enter (Windows) or Return (macOS), or right-click (Windows) or control+click (macOS) the mask name and select Rename.
  • When you create additional masks for one layer in the Layer panel, make sure that the Target menu in the Layer panel is set to None; otherwise, you replace the targeted mask instead of creating a mask. You can also lock a mask to prevent changes to it.
  • When creating or editing masks, look in the Info panel for information such as the mask name and the number of vertices in the mask.

Create a mask that moves independently of its primary layer it is masking

  1. Create the mask on a separate white solid layer, and use that solid layer as a track matte for the primary layer.

  2. Use parenting to make the solid layer a child of the primary layer so that the mask moves with the primary layer as if applied directly. Because the solid layer is a child layer, it can also be animated independently of its parent.

  3. You can use motion tracking to make the solid layer (and, therefore, the mask) follow moving objects in the primary layer. Learn about converting a layer into a track matte and parent and child layers.

Create a mask by dragging with shape tools

The shape tools are the Rectangle , Rounded Rectangle , Ellipse , Polygon , and Star tools.

Tip:

To activate and cycle through the shape tools, press Q.

A polygon is a star without an Inner Radius or Inner Roundness property. So, the name of the shape created for a polygon or a star is the same: polystar.

You can create a mask by dragging with a shape tool on a selected layer in the Composition or Layer panel.

Note:

To draw a mask on a shape layer, select the Tool Creates Mask   button in the Tools panel with a shape tool active.

Create a rectangular or elliptical mask numerically

  1. Select a layer in the Composition panel or display a layer in the Layer panel.

  2. Select Layer > Mask > New Mask. A new mask appears in the Composition or Layer panel with its handles at the outer edges of the frame.

  3. Select Layer > Mask > Mask Shape.

  4. Select Reset To, choose Rectangle or Ellipse from the Shape menu, and specify the size and location of the bounding box for the mask.

    The Mask Shape dialog box is open and there are settings for Bounding Box and Shape to configure.
    Use the Mask Shape dialog box to create, refine, and adjust Mask properties numerically.

Create a mask from channel values with Auto-trace

You can convert the alpha, red, green, blue, or luminance channel of a layer to one or more masks by using the Auto-trace command. Auto-trace creates as many Bezier masks as necessary to outline the specified channel values in the layer. It also creates masks with the smallest number of vertices possible while conforming to the settings that you choose. You can modify a mask created with Auto-trace as you would any other mask, and you can link its path to other path types, such as shape paths on a shape layer, using expressions.

When you apply Auto-trace, affected layers are automatically set to Best Quality to ensure accurate results.

Note:

To reduce the number of masks created by Auto-trace, apply a keying effect to the layer to isolate your subject before applying Auto-trace.

  1. In the Timeline panel, do one of the following:

    • To create mask keyframes at a single frame, drag the current-time indicator to the desired frame.
    • To create mask keyframes across a range of frames, set a work area that spans that range.
  2. Select one or more layers and choose Layer > Auto-trace.

  3. Select one of the following:

    Current Frame

    Creates mask keyframes at only the current frame.

    Work Area

    Creates mask keyframes for frames within the work area.

    Once done, select from any of the following options:

Invert: It inverts the input layer before searching for edges.

Blur: It blurs the original image before generating the tracing result. Use it to reduce small artifacts and to smooth jagged edges. Deselect this to closely trace details in a high-contrast image.

Tolerance: How far, in pixels, the traced path is allowed to deviate from the contours of the channel.

Threshold: Specifies, as a percentage, the value that a pixel’s channel must have for that pixel to be part of an edge. Pixels with channel values over the threshold are mapped to white and are opaque; pixels with values under the threshold are mapped to black and are transparent.

Minimum Area: Specifies the smallest feature in the original image that is traced. For example, a value of 4 removes features smaller than 2 pixels wide by 2 pixels high from the tracing result.

Corner Roundness: Specifies the roundness of the mask curve at vertices. Enter a higher value for smoother curves.

Apply To New Layer: Applies the mask to a new solid the same size as the selected layer. It's automatically selected for layers that have Collapse Transformations enabled.

Preview: Select to preview the mask results and the results of the various options of the Auto-trace command.

Create a mask of the size of the layer

  1. Select the destination for the new mask:

    • To create a mask, select a layer in the Timeline, Layer, or Composition panel. To create a mask on a shape layer, select Tool Creates Mask   in the Tools panel with a shape tool active.
    • To replace a mask path, select the mask in the Timeline, Layer, or Composition panel.
  2. In the Tools panel, double-click the Rectangle , Rounded Rectangle , Ellipse , Polygon , or Star tool.

Create masks from text characters

The Create Shapes From Text command extracts the outlines for each character, creates shapes from the outlines, and puts the shapes on a new shape layer. You can then use these shapes as you would any other shapes. It extracts the outlines for each character, creates masks from the outlines, and puts the masks on a new solid-color layer. You can then use these masks as you would any other masks.

create mask from text

  1. Select the text to convert to masks:
    • To create masks for all characters in a text layer, select the text layer in the Timeline or Composition panel.
    • To create masks for specific characters, select the characters in the Composition panel.
  2. Do one of the following:
    • Select Layer > Create Masks From Text.
    • Right-click (Windows) or Control+click (macOS) the layer or text and choose Create Masks From Text from the context menu.

Points to note

  • The Video switch   for the text layer is turned off.
  • The new solid-color layer is created at the top of the layer stacking order.
  • For characters that consist of compound paths—such as i and e—multiple masks are created and combined with the Subtract mask mode.

Create a mask from a motion path

You can copy position keyframes, anchor point keyframes, or an effect control point's position keyframes and paste those keyframes into a selected mask path or shape path. When you create mask paths or shape paths from motion paths, make sure that you copy keyframes from a single Position property only—don't copy the keyframes of any other property.

Tip:

Draw a motion path with Motion Sketch (Enable the panel by selecting Windows > Motion Sketch) and then paste the path into a mask path or shape path.

Note:

When copying between a mask path to a motion path, keep in mind that the mask path’s values are expressed in the coordinate system of the layer (layer space), whereas the motion path’s values are expressed in the coordinate system of the composition (composition space). This difference causes the pasted path to be offset, requiring you to reposition the path after pasting it. Learn more about coordinate systems – composition space and layer space.

Create a mask path from a motion path

  1. In the Timeline panel, select the name of the Position property or Anchor Point property from which you want to copy the motion path. This selects all keyframes. However, to select only some of the keyframes of a motion path, Shift+click them.

  2. Select Edit > Copy.

  3. To create a mask, select the layer on which to create the mask, and select Layer > Mask > New Mask.

  4. In the Timeline panel, select the name of the Mask Path property for the mask into which to paste the keyframes from the motion path.

  5. Select Edit > Paste.

Get help faster and easier

New user?