After Effects I | Masks and Effects


Masks and Effects

What's underneath? Mask effects reveal all.

In the first three lessons we explored how to import Photoshop and Illustrator files and create our own text layers in AE. This enabled us to composite or place these layers on top of each other to produce multi-layered animations.

Compositing is the heart of After Effects. AE allows us to combine video files, stills, and Photoshop and Illustrator art (and more) into a single animation.

Better yet, it allows us to stack layers and see layers that appear below other layers in the stack through transparency. In this lesson we'll explore how to use masks to your advantage in After Effects, showing and hiding elements in your animation when you need to. We'll also look at just some of the many effects that put the 'E' into AE.

Click here for lesson downloads.

In this lesson, you can expect to:

Learn how to use the Alpha Channel to manage transparency.
Learn how to set up masks on layers and use mask modes.
Learn how to paste masks from Photoshop and Illustrator.
Learn how to apply effects.
Learn how to use effects with masks and paths.


 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The Alpha channel is one way of using transparency.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

A value of 0 is black—it's completely transparent.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

You can create a mask to add an alpha channel with a specific shape to a layer.

 

Channels in AE

 

If you've studied Photoshop, you'll know that the color information for files is managed in channels: RGB or CMYK.

Because AE creates art and animation for screen display, the images you'll be using in AE will all be in RGB color space. As a matter of fact, AE won't even import a CMYK file.

Every RGB image is made up of 3 color channels: Red, Green, and Blue. Each one of these channels contains information that, through sort of a channel sandwich, puts together a color image.

In this course we'll be working with 8 bit per channel (8bpc) files, which have 256 shades of color (0-255). Files with greater bit depth offer logarithmically more shades per channel and are much higher in resolution. The other bit depth supported in AE is 16 bpc, which has 65536 shades per channel.

Let's explore how to control color in After Effects.

Using the Alpha Channel

The alpha channel can be used for basic transparency. To find out what I mean, create a new 320x240 comp and create a new text layer. Import the Circle.ai file from Lesson Two and place it underneath the text layer in the stack.

Click on the red channel button at the bottom of the comp window.

And click on the green channel:

and the blue channel:

Finally, click on the alpha channel:

In the alpha channel, the transparent information is black, and the areas with information are white. The alpha channel of an 8 bit file also has 256 shades. 0 is Black and it's completely transparent. 255 is pure White and it's completely opaque. Any value between 1-254 will be a shade of grey; grey isn't transparent or opaque, it's somewhere in between, depending on where it falls between 0-255.

With the alpha channel still selected, solo the text layer.

The two layers you have created have an automatic alpha channel that can be used for transparency in your animations.

About half the time, though, you'll work with files that don't have an alpha channel, and if you want to see underneath them in a stack, you'll have to make your own transparency. Video files for instance don't have alpha channels because the channels are married together. That's why people shoot on greenscreen and bluescreen and then key out the background so they can composite their video later.

Masks

Setting Up Masks

Import one of the video files from the Artbeats folder in Lesson Four downloads. These five files were provided to us by Artbeats (http://www.artbeats.com/). Check out their Web site to see more of their fantastic stock footage. Once you see your video file in the project window, drag it on top of the New Composition Button at the bottom of the project window.

This will make a new composition that will match all the specs of the video: name, duration, size, and pixel aspect ratio. Click on the arrow in the upper right of your comp window to access and view your new video comp's settings.

Click on the Alpha Channel button. The channel is completely white, meaning there is no transparency.

Click on the alpha channel button again to go back to viewing the composite RGB. From the toolbar, select the Rectangular Mask Tool and hold the mouse down to reveal the Elliptical Mask tool underneath and select it.

In the comp window, click and drag a new elliptical mask onto the video layer. Hold down the shift key to make a perfect circle.

Click the Alpha Channel on and off. Yay. Transparency. Go back to the selector tool and double-click on the mask. There should be a bounding box around the mask. The handles are known as Free Transform Points. The shortcut is Command T when you have Mask selected in the Timeline.

You can scale the mask or change its shape by pulling one of the corners or points in the middle on the side. Hold down the Shift key to constrain proportions during a scale. Hold down the Shift and Command Keys (Shift Ctrl) to scale from the center point of the mask. Click the Return or Enter Keys when you are done transforming.

You can also modify individual vertex points. You must click exactly on a vertex point to access it. Make sure your layer is selected so you can see the mask. Sometimes it takes a few tries to select a vertex. Keep trying until you can pull one of the vertex points away from the circle, using the Beziers handles again. Multiple vertex points can be selected by holding the shift key as you select. You can Free Transform just those points. After you select the points, press Command T (Ctrl T).

You can manipulate any vertex and therefore you can also animate a mask over time.

If you don't see the word Mask in the Timeline, select the layer and press the m key twice (mm). This will reveal the mask properties: Mask Shape, Mask Feather, Mask Opacity, and Mask Expansion. Set a keyframe at 0 for your current mask shape and move to 2 seconds and change your mask. Do a RAM preview. What you will see is the wonders of mask interpolation!

Another transparency technique to consider is called rotoscoping. Using rotoscoping, you mask out a figure from video footage and keyframe every frame. Video is around 30 frames a second, so you can imagine how long it takes to rotoscope a 30 second video clip (that's 900 frames). Sometimes you have no other option though.

Tip: You can make a rough mask and then add vertex points with the Add Vertex Point tool. You can also delete points with the Delete Vertex Tool.

  

Be aware though that if you are animating a mask shape you shouldn't add or delete points because once a point is deleted it is deleted in all of time and space. There is a handy preference to protect you (below). We'll discuss rotoscoping further later the lesson.

If you want to add a diffuse border to your mask, change your mask feather to 40 pixels to get a diffuse edge and turn on the Alpha Channel again. You'll see shades of grey which are partially transparent.

 

 

 

 

 

 

Experiment with mask modes to find out different ways of using masks.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Masks can be pasted in from Photoshop and Illustrator too.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Masks can be created from shapes and saved as presets.


Using Mask Modes

Mask modes offer different options help you toggle around and see what you want through your mask.

The current and default mask mode is the Add mode, which adds a mask to a layer, making the rest of the layer transparent. But maybe you'd like to reverse things. Click on the mode menu and change the mode to Subtract.

Now the mask will subtract the pixels inside the mask from the alpha.

The None mode means that the mask will not affect the alpha of a layer. There are effects that use masks and you may want to have a mask on a layer but not to change the alpha. We'll look at these effects later in the lesson.

The Intersect mode will only work if you have two or more masks overlapping in a layer. The same applies to the other modes.

You can create masks with the Rectangular and Elliptical Mask tool and you can also draw your own using the pen tool. Select the pen tool from the Tools palette and draw another mask on the same footage layer. The second mask will appear in the timeline.

Change the mode of the second mask to Intersect.

Then try Difference. You'll see that the overlapping area is masked out:

Now change the mode of the first mask. Play around with this to get comfortable.

Change the opacity of one of the masks to see the Lighten and Darken Modes in action.

Delete both masks and select the pen tool again from the Tools Palette. Select Layer>Mask>New Mask, select the new mask in the timeline, and go to Layer>Mask>Rotobezier. This time click on the Rotobezier option and draw another mask. No Bezier points. You can convert a Rotobezier mask to a Bezier mask and vise versa. Select the mask and go to Layer>Mask> and uncheck or check the Rotobezier option.

If you need to reposition the layer inside the mask select the Anchor Point Tool (a.k.a. The Pan Behind Tool), click on the layer in the comp window and drag it to its new position. The mask will stay in the same place in the window.

Pasting Masks from Photoshop and Illustrator

In Lesson Two we discussed copying and pasting shapes from Illustrator and Photoshop into the Position property of a layer to make a motion path. Copying and pasting masks is done in much the same way except you must have the mask selected in the Timeline instead of the position property.

Open Photoshop, make a new document 320x240, 72 dpi, RGB, and select Don't Color Manage.

To save you the trouble in the future click on the save preset button. Name your preset and click OK.

Next time you go to make a new document this preset will be available from the presets menu bar.

A custom shape created in Illustrator

Once you have your new document open, make a new custom shape layer. Here I have created my own ladies restroom symbol (right). Select it with the Path Selection Tool, and copy it into the clipboard (Command C or Ctrl C).

Go back to After Effects, create a new comp, and paste your shape on a new solid layer.

 

 

 

 

You will notice that when I pasted my path it pasted as two masks. That's because the head and body aren't joined.

Try this again but choose a shape that has one mask. If you want to use the same shapes I did you can open the Simple Shapes.psd file in your downloads folder.

Copy and paste it into a solid layer in AE and make a Mask Shape Keyframe.

Now go back to Photoshop and make a second simple shape layer. Copy that.

Go back in AE, move down in the timeline, and with the Mask Shape selected copy the second shape. Do a RAM preview to see the mask interpolation. Sometimes this is successful and sometimes not so much. There is an option in AE Pro to make this better which we'll cover at another time.

There is a file in the Renders folder called Love Blooms.mov demonstrating this in action.

Note: You can copy masks from layers to other layers within AE as well as paste from other applications. You can also change the colors of masks by clicking on the colored square to the left of their name on the timeline, which activates the color picker, and choosing an alternate color.

 

 

 

 

 

 

Set aside some time to play with effects.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The AE Help disk has some good reference materials that can help you identify the effects you like.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Consider that masks and effects can be combined, multiplying your options.

 


Applying Effects

We briefly touched on applying effects in Lesson Three when we applied the Basic and Path Text Effects to a solid. There are loads of effects you can use in AE, especially if you have the AE Pro. (I highly recommend getting AE Pro if you don't have it). There are also a TON of third party plug-ins you can buy for AE.

A great Web site to research, find plug-ins, download demos, and purchase plug-ins for AE is Toolfarm.com. They also have tutorials. Double yay!

You may see some effects in my screenshots that you don't have and most likely they are sold separately. There is one suite of plug-ins called Trapcode you should treat yourself to. These plug-ins are beautiful, fast, and fairly inexpensive compared to some other suites. Everything they make is amazing. You can download demos and tutorials for the plug-ins from their site.

There are too many effects available to talk about each one. But I'll profile a few and that should get you started. You should set aside some time and play. There are QuickTime files for the profiled effects in the Renders folder.

Fast Blur

Make a new text layer and select it. Go to Effect>Blur & Sharpen>Fast Blur to apply a Fast Blur Effect. Fast Blur is used a lot in car ads.

By the way, if you know what effects you're looking for you can search for them in the Effects & Presets Palette. Open the palette and type in Blur to see all your blur effects.

Set a keyframe for 0 blurriness at 1 second.

Move to the beginning of the timeline. The shortcut to move to the beginning of the timeline is the Home Key and the End key will move you to the end of the timeline. Change the Blur Dimensions to Horizontal and set a keyframe for a blurriness of 800.

Do a RAM preview. This effect is used extensively in broadcast graphics, especially in car commercials.

CC Light Sweep

Turn off or delete the Fast Blur effect. Close out any other comps too as they might inhibit your playback for this next effect.

If your text is white, double-click layer and change the color to something darker. (Click on the color square in the character window and choose a new color from the Color Picker). Once that's done, make sure the layer is selected and go to Effect>Render>CC Light Sweep.

If you don't see any CC effects you may not have installed them from the AE install disk. Quit AE and install them now.

Expand the effect in the timeline. Move the Y-axis Center down to match the center of your text and scrub the X-axis value to see the light sweep over the text. Make a keyframe at the beginning of the timeline where the X-axis value is off to the left of the text layer and not affecting the layer.

Now go to 1 second and make a keyframe where the X-axis value is off to the right of the text and is again not affecting the layer.

I changed a few global properties in my effect until I was happy with the results. You'll notice I changed the Light Color, Width, Intensity, Edge Thickness, and Direction. You'll only learn what you want by playing with the parameters.

Do a RAM preview. Pretty.

Basic 3D

Turn off or delete the CC Light Sweep effect. We won't be addressing true 3D space in this course but there is a useful 3D-like plug-in called Basic 3D. Make sure the text layer is selected and go to Effect>Perspective>Basic 3D.

You can use this effect to add a bit of perspective to a layer.

Or you can animate it to make it appear in 3D space. Here are the settings I used to create the Basic 3D Quicktime.

If you love what you've done with the Basic 3D effect you may want to save your settings as a favorite. Select the effect in the timeline and go to Effect>Save Animation Preset. A window will open from your Presets folder. Name your Effect and click OK.

You'll now be able to access this effect from Animation>Recent Animation Presets. You'll also see it in the Effects & Presets Palette, just like you did when you saved your text preset.

Select the Basic 3D effect in the timeline and delete it. Go back to Effect>Perspective>Basic 3D to apply the effect again. This should open the Effects Controls window located under Effects>Effect Controls. Now from the Effects Controls Window, choose the Animation Presets menu where any presets using the 3D effect will be displayed. Select your preset from the dropdown menu and behold: your preset, keyframes and all, is applied to the layer.

More than one effect can be saved in the same preset. We haven't addressed using more than one effect at a time, but now you know for future reference.

That should be a good start. Have a look at the other effects and play around with the animating parameters. If you want more info about the effects there's a pdf file called AE Help on the install CD that you should copy to your computer:

This is a great supplement and different from using the Help menu from AE. Notice there's a separate pdf for the Cycore Effects (CC effects).

Some advanced effects such as the Audio Effects, the 3D Channel Effects, Keying, Matte Tools, and some of the Simulation Effects (Particle Playground, Wave World, Caustics, and Foam) are perhaps best ignored for now. These are complicated effects that we'll address in a Level II AE course.

Effects that Use Masks and Paths

We discussed earlier that sometimes animators apply masks to layers but set the mode to None because they want to use it for an effect, not to change the alpha channel.

You know what that means by now. There are some effects that use both masks and paths. Here are a few:

 
 
  • Stroke
  • Scribble
  • Vegas
  • Fill (closed paths only)
  • Smear (closed paths only)
 
 

Let's take a look at the first two.

Stroke

Delete the text layer and make a new solid layer. Select the elliptical mask tool and draw a circular mask on the layer. Change the mask's mode to None. With the layer selected, go to Effects>Render>Stroke.

In the Effects Control Window, change the path from none to Mask 1. Notice that under Paint Style you can composite the stroke on the original image (in my case a green solid) or on a transparent layer where you'd just see the mask. Scrub the start value to see the stroke write on.

Set keyframes in the timeline to animate the stroke you are writing on. When the start and end values are both set to zero the stroke will complete the circle. Also, play with the spacing. At 100% the stroke becomes a series of dots. Have a look at the Stroke_Animation.mov file.

Don't forget to have fun with this. You could animate the color of the stroke. And you could animate the mask as well as the stroke. Have a look at the Stroke and Mask Animation.mov file.

Scribble

Scribble is new to AE 6.5. Remove the stroke effect from your elliptical mask and go to Effect>Render>Scribble and do a RAM preview. Cute.

Play around with the various parameters here especially the Edge Options. These are available if you fill type to something other "inside."

What's it all about? Look at the Scribble.mov file and see.


 

 

 

 

 

 

 

 

 

 

 

Masks can also be created from alpha channels, or even text layers.

 

Converting Alpha Channels to Masks

So far in this lesson we've been drawing or copying and pasting masks but you can also convert Alpha Channels to masks.

Import the file Vegas_sign.ai from your downloads folder as Composition – Cropped Layers. Open the comp, select the sign layer, and go to Layer>Auto Trace.

The Auto Trace Window opens and asks you how detailed a trace you want:

Choose to preview the generated mask. We just need to trace the current frame because the alpha on our layer isn't animated. The trace on this particular layer is pretty simple and the default trace will be fine. On more complex layers you'll have to play with the parameters to get a satisfactory trace.

Click OK to see your mask.

Select the sign layer and go to Effect>Render>Vegas. In the Effect Controls Window, change Image Contours to Mask/Path and play with the render settings until you get "lights" you're happy with.

At the beginning of the timeline set a keyframe for 0 rotation (rotation in the effect—not in the transform properties for the layer). Then set a keyframe a couple of seconds later with a rotation of 4 complete revolutions. Do a RAM preview. Nice, but something weird is happening. The edges of the effect are being cut off!

That's because the effect is going beyond the information boundary in the layer. We are going to have to Pre-Compose this layer. Pre-composing will place the sign layer in its own comp and then we'll apply the Vegas Effect to the comp which will solve the cutting off issue.

Select the sign layer and go to Layer>Pre-Compose.

The Pre-Compose Options Window Opens. You can choose to move the mask and the effect into the new comp. We don't want to do that, so choose to leave everything in the Vegas comp and name your pre-comp. Check the Open New Composition button because we must modify the size.

When the precomp opens, press Command K (Ctrl K) to open the comp settings. Uncheck the Lock Aspect Ratio and enter 500 for the width and 300 for the height. Then click OK.

Now there is a nice amount of breathing space between the layer and the edges of the vegas_precomp. Go back into the vegas_sign comp. Your sign layer is now a nested comp and has the icon of a comp. To open a nested comp hold down the Option Key (Alt) and Double-Click the nested layer. One thing you can't miss is that our Vegas effect is now way off the mark.

This happened because the mask was based on the size of the layer and when we made the nested comp bigger the mask also got bigger. Delete the mask from vegas_precomp layer. Go into the vegas_precomp, choose the sign layer, and auto trace it again to generate a new mask. Copy the mask, go into the main vegas_sign comp, and paste the mask into the vegas_precomp layer. Go into your Effects Controls and change the Mask to the mask you've just pasted. Now everything should look great. Check out Vegas.mov to see the finished file.

We'll talk more about precomps and nested comps in the later lessons.

Generating Masks from Text Layers

Let's go back to working with text for the last part in this lesson. Here's another thought-starter. For each character in a text layer, you can create a separate mask.

Make a new comp and create a new text layer.

Select the layer and go to Layer>Create Outlines.

Voila! Masks on a new layer. I got more masks than characters because I have an O which becomes two masks. You don't have to outline the entire layer, you can also select certain characters and choose to outline only them.

Now you can have scribble text if you want. Select the new layer and apply the Scribble effect. This time chose to scribble all masks. In the Effects Window, choose All Masks Using Modes to keep the hole in your O.

Check out Scribble Text.mov to see the result. Working with layers and effects is fun. Take a breather and recap this lesson's shortcuts before moving on to the exercise.

Task Shortcut

Apply Mask to Free Transform Points

Command T
Constrain proportions during a scale Shift key

Scale from the center

Hold down the Shift and Command Keys (Shift Ctrl)
Go to the beginning of the comp Home key
Go to the end of the comp end
Open a nested layer Option Double-Click (Alt Double-Click)
mm reveal Mask properties
     
Learn how to apply blending modes to correct images and create effects.
Learn tips for situations in which to use blending modes.
Learn how to speed up or slow down time in your movies.
Learn how to use Paint, Clone, and Erase tools.
 

Exercise
Create another TV preview sequence (looks like you got this gig) this time working with a layered Illustrator file and using masks and effects.

Discussion
Share your thoughts and opinions with other students at the Discussions Board.