All Articles After Effects
After Effects: Animated Christmas Trees
Richard Lainhart on Thu, December 22nd 0 comments
Decorating a Christmas tree can finally be done from the comfort of your sofa or desk. Well, decorating a virtual Christmas tree that is... Richard Lainhart adds a sparkle to his using After Effects.

In this seasonal article, we'll show you how to take a still image of a Christmas tree and animate the lights so they sparkle in a cheerful holiday manner, and all without setting a single keyframe. Let's get started.

Step 1 - Set up the First Comp

First we need an image to work with: here's one I took some years ago of one of our Christmas trees, which I've set up in a 15-second 720p composition I'm calling "Tree Matte Comp" (you'll see why in a minute):

Tree Matte Comp

This is a landscape mode image, obviously, so our final animation will be pillarboxed, with black bars on both sides. Whatever image you use should have nice bright lights on the tree itself without other bright lights elsewhere in the image.

Step 2 - Apply a Luma Key to the Image

Next, with the image selected, choose Effect > Keying > Luma Key. We're going to use the Luma Key to create an alpha matte for the image that will mask out everything except where the lights themselves are located. To do that, set your Luma Key parameters as shown:

Luma Key Parameters

When you do, you'll see this:

Luma Key result

Now, anything we composite in the comp using this matte will only be visible through the holes created by the Luma Key.

Step 3 - Apply Matte Choker

Next, choose Effect > Matte > Matte Choker. The Matte Choker is normally used to tighten up a matte, but we can use it with negative values to increase the size of a matte. In this case, so more of our sparkles show through in the final composite (again, this will make more sense in a minute.)

Use these settings for your Matte Choker (note the negative Choke 1 value):

Matte Choker settings

And when you do, you'll see that the matte holes are larger and a little softer.

result of Matte Choker

You'll also see a little of the original colors leaking through, but don't worry about that.

Step 4 - Create a New Comp

Next, create a new 15-second 720p comp called "Sparkle Comp", and drag the Tree Matte Comp into it. After that, choose Layer > New > Solid to create a new solid in this comp. Make it the full size and length of the comp, of any color, and call it "Sparkles". Drag this layer in the Layer pane in the Timeline so it's below the Tree Matte Comp, and turn off the visibility of the Tree Matte Comp.

The new comp

Step 5 - Apply CC Particle Systems II

Next, with the Sparkles layer selected, choose Effect > Simulation > CC Particle Systems II. We'll use this to create the sparkles for our lights. Here are the parameter settings I used (you should, of course, experiment with all these settings):

CC Particle Systems II

Let me explain these settings a bit: First, the high Birth Rate with a low Longevity means that the particles will appear quickly but will also die out quickly, giving us our basic sparkle activity. The large X and Y Radius settings means that the particles will cover a large initial area. The low Velocity and zero Gravity mean that the particles won't move around much before fading away. Setting the Particle Type to Star gives us a nice sparkly particle, and setting the Birth Size and Death Size the same means that the particles will all be roughly the same size. Finally, setting the Birth Color and Death Color both to white gives us white sparkles. 

If you've set everything correctly, your sparkle animation should look something like this:

Step 6 - Apply a Track Matte to the Sparkle Layer

Next, click the Toggle Switches/Modes button at the bottom of the Layer Pane in the Timeline to show the TrkMat column, then choose Alpha Matte "Tree Matte Comp" for the Sparkles layer's Track Matte. This will mask with the sparkles with the tree lights matte, so you only see the sparkles where the lights are located.

You should have a pretty clear idea now about where we're going with this: when we composite this comp on top of the original image, we'll have some nice sparkles aligned with the original lights.

(This, by the way, is basically the same technique I used for the "Beam Me Up Scotty" effect I recreated for this article.).

One last thing to do here before moving on: you'll notice that there's a brief period of black at the beginning of the sparkle animation. This is because the particles take a few frames to get going, which is a common situation with particle systems. To avoid that, just grab the layer bar for the Sparkles layer and drag the whole thing to the left about a second or so; this will make the sparkle animation start before 00:00, so the sparkles will be at full strength at the start of the animation. This will leave a gap of a second at the end of the comp, but since our final comp will only be 10 seconds, this won't be a problem.

Step 7 - Create the Final Comp

OK, here's the last step: Make one last 720p comp, this time 10 seconds long, and call it "Final Comp". Drag your original tree image into it, making sure it's the same size and position as the one in the Tree Matte Comp. Then drag the Sparkle Comp into this new comp so it's above the original image.

Finally, click the Toggle Switches/Modes button, if necessary, to show the Mode column, and choose Add Mode for the Sparkle Comp layer.

the Toggle Switches/Modes button

This will add the brightness of the pixels in the Sparkle layer to the pixels below it, reinforcing the sparkling animation. If you've followed all the steps correctly, you should see something like this in your final preview:

As always, you should experiment with the settings I've given you here to see how they affect the final results, and above all, have fun.

Seasons Greetings!

Comments (0)

You must be logged in to comment.

Course Advisor
Don't Know Where To Start?
Ask A Course Advisor
Ask Us!
Copy the link below and paste it into an email, forum, or Facebook to share this with your friends.
Make money when you share our links
Become a Affiliate!
The current affiliate rate is: 50%
Classes Start Next Week!
Live 8-week Online Certification Classes for: