Quick Effect: Magnifying Track Matte

Dec 22nd in Motion Graphics by Mark Brodhuber

This tutorial will teach you how to generate a magnifying effect with the use of an animated track matte. The final effect can be used for many purposes, particularly to create a sophisticated background for other elements, such as logos and text.

This tutorial is ideal for beginners or experienced After Effects users who want to quickly learn an attractive and simple technique.

PG

Author: Mark Brodhuber

Mark Brodhuber is Site Manager at VideoHive.net, an Envato creative marketplace.

Preview

Get the Flash Player to see this player.

Download

Preview

Step 1

Open After Effects, and create a new composition (up top click "Composition -> New Composition"). Use the settings in the image when prompted. This will create a new composition that is 1280x720 that is 10 seconds long. After you learn, you can set your composition to whatever resolution suits your needs.

Step 2

Next you will need to draw a rectangle shape in this new comp. First you will need to zoom out quite a bit to see beyond the visible comp. You'll see why in the next step. Zoom out by scrolling your mouse wheel down, or use the zoom drop down on the bottom left of your comp. Next use the rectangle tool, and draw a thin white rectangle that overlaps the top and bottom of your composition as shown in the below image. The color white for the bars on a black background is important.

Step 3

Now we will add an expression to the rectangle called Wiggle. What it will do is "wiggle" the layer randomly over time. We are trying to generate a smooth side to side movement. This can be keyframed but let's allow the expression to do the work for us.

Navigate to the layers and drop down the arrow for the rectangle exposing its properties. Then drop down "Transform". Hold Alt/Option and click the stopwatch next to the "Position" property. This will allow you to add an expression. Paste this code in that area (without the quotations, of course) "wiggle(1,65)".

The first value in the wiggle expression is the "frequency" which defines how many wiggles occur every second. The second value in the expression determines how many pixels the object is allowed to move. This movement is why we made the shape larger vertically than the composition to prevent the shape's top or bottom from moving into view. It also helps simulate a side to side movement only. Try to preview the animation at this point and watch your little rectangle move!

Step 4

Once this is done you will need to duplicate your rectangle 25 times (select the layer and hit CTRL+D). I know this seems excessive but it will pay off.

Each instance/copy you make, you need to move and randomly resize each one. Refer to the below image for an example, then create your own version.

Note: Feel free to play this step by ear. You don't have to copy my example: add a few more copies, and play with sizing. Also, from trials I have found that a lot of smaller copies tend to add to the end effect. It's also OK to position some off stage... if close enough, they will move on stage at some point.

Step 5

Your track matte is complete. You will now need to create a new composition within the same project. Once again, go to the top and select "Composition -> New Composition". Use the same settings shown in Step 1. This new comp is where we will pair our footage with our moving bars track matte.

Step 6

Go to "File -> Import -> File" and select your footage. Since we are working in an HD format composition, I suggest using footage that is at least as large as the comp. By importing smaller footage you will need to scale the footage up, and could risk loosing quality. Once the import is complete you should now have 3 files in your "Project" panel (Comp 1, Comp 2, and your footage). I'm going to use a stock image to demonstrate the effect. Stock image can be found here: Link.

Step 7

Place your footage on the timeline of Comp 2. Ensure it is centered on the stage. Select that layer and again use Ctrl+D to duplicate your footage layer.

Now you have two copies of the same footage on your timeline. Lastly, you need to pull "Comp 1" from the project panel to the top of your layer stack. Turn off the visibility of your "Comp 1" layer. Do this by clicking the small eye icon to the left of the layer. If the matte is visible it will only look like a black and white animation, whereas the footage is the meat and potatoes of the project and that's what we want to be able to see!

Step 8

Essentially, the matte we created in Comp 1 is a looking glass through to the two footage layers. The setup we are preparing will display the bottom footage layer in all of the black areas of the track matte, and will display the top footage layers in all of the white areas of the track matte. This is why it was so important to work with a black background and white rectangle shapes.

To be able to see the effect we need some difference between the two footage layers. To create this, we are going to scale the top-most footage layer up 5%. Drop down your top-most footage layer (the middle layer of the three) and then drop down "Transform". Click the value in the scale property and change it to 105% and finally drop down the "TrkMat" for that layer and select "Luma Matte - Comp 1".

By increasing the scale on the top footage layer, it gives off a magnified/displaced effect.

Step 9

Render your "Comp 2" and you will end up with your video!

Additional Suggestions

This end result is just one of the many paths that could have been taken from the beginning of the tutorial. To achieve different results, you can tweak a number of different things.

  • Change how many shapes you place on the stage.
  • Vary the size of the shapes.
  • Change the values of the wiggle setting to make it faster/slower or to make it move more/less.
  • Give each shape a different wiggle setting... have them all moving at different speeds.
  • Blur the top or bottom footage layer.
  • Make one footage layer greyscale and the other footage layer color.
  • If at any time you feel you need to make a change to your track matte you can go back into your "Comp 1", make the change, and when you change back to "Comp 2" your change with automatically be reflected in the project.

The wiggle expression used here is bare-bones basic. After getting acquainted with things, you may want to check out AutoExpress. It's a script for After Effects that will allow you to apply the wiggle as though it was an effect rather than having to type the script manually. You can also add smoothing and looping to the equation to further the possibilities of this project!


Enjoy this Post?

We'd love your vote!

Plus Members

Source Files, Bonus Tutorials and
More for $9 a month for all Tuts+
sites in one subscription.

Join Now

User Comments

( ADD YOURS )
  1. PG

    Daniel December 22nd

    Cool…

    btw a non-video tutorial :-)

    Keep going

    Daniel

    ( Reply )
  2. PG

    TY December 22nd

    Pretty Cool! Thanks for this… Love our tuts!

    ( Reply )
  3. PG

    Ariful Alam Khan December 22nd

    good tutorial. Thanks

    ( Reply )
  4. PG

    Rik December 22nd

    Nice and very simple, yet effective! :D

    TYFM!

    ( Reply )
  5. PG

    Johan December 22nd

    I have a x-mas wish.

    It would be good if you guys had atleast 1 tutorial for beginners. (?)

    ( Reply )
  6. PG

    Nate December 22nd

    Awesome! Easy, and effective! I think I prefer the step by step tutorials so I can go at my own pace compared to the quick step-step-step video tuts where I have to pause, go to my window, and etc.

    ( Reply )
  7. PG

    Jhay December 22nd

    Nice tutorial! Thanks

    ( Reply )
  8. PG

    Evan Riley December 22nd

    Very sweet technique, i was actually watching something and i really wanted to know how to do this, came just in time :)

    ( Reply )
  9. PG

    Dave December 22nd

    Interesting tutorial, I think it’d be nice if you can maybe find some good examples around the internet of how this is used in a more practical format just so we can see some of the potential.

    ( Reply )
  10. PG

    MOHNAD December 22nd

    Thanks

    ( Reply )
  11. PG

    loswl December 22nd

  12. PG

    Josh Drake December 22nd

    Pretty cool effect! Thanks for the tut!

    ( Reply )
  13. PG

    James December 22nd

    Here is another tutorial that is similar:
    http://library.creativecow.net/articles/james_colin/glass.php

    Also, Andrew Kramer has a basic training for anyone interested:
    http://www.videocopilot.net/basic/

    There are more advanced tutorials on the main site.

    ( Reply )
  14. PG

    DKumar M. December 22nd

    Nice tutorial Mark… really stunning outcome. Thanks for shearing !!

    ( Reply )
  15. PG

    Justin Scott December 22nd

    Cool, thanks man.

    ( Reply )
  16. PG

    Page Gardens December 22nd

    Beautiful effect.

    ( Reply )
  17. PG

    Josh December 22nd

    @Johan
    I’d say this is pretty much beginner…
    If you still really want beginner tutorials, check out the ones that are already made. There’s no point repeating whats already out there on the web. VideoCopilot has a good (and free) beginner AE tutorial series. Why don’t you go take a look at that?
    http://www.videocopilot.net/basic/

    ( Reply )
  18. PG

    Mark Brodhuber December 23rd

    Hey guys, thanks for the great comments. This is a very beginner tutorial. The point I tried to hit here was less about the effect and more about a basic walk through from some basic tools of the software.

    Importing, layer properties, track mattes, VERY basic expressions, pre-comping, etc. Basically touching on a few key points to achieve a basic, but clean result.

    I have actually recently saw this effect used on a HD tv at a car dealership, and it was using still photography of the cars, but there were A LOT more thinner lines, and the lines also helped transition from image to image.

    Once you begin to grasp the concepts you can really grow on the techniques.

    I hope you guys enjoyed my first tutorial! I have another beginner tut coming soon!

    ( Reply )
  19. PG

    Chris December 23rd

    @Johan – This is pretty much a beginner tutorial. It’s not as involved as the other tutorials. That being said, I never thought to use track mattes in this way before. Thanks for the idea!

    ( Reply )
  20. PG

    Snorri3D December 23rd

    None Video tuts.
    I like them better i got to say.

    AETUTS is awsome keep up the good work :D

    ( Reply )
  21. PG

    Diablo December 28th

    Cool tutorial, man. I would suggest, though, that instead of making 25 masks and then using wiggle to animate them, you could just use a pre-composed fractal noise as your track matte and animate the evolution. I would save you a lot of time.

    ( Reply )
  22. PG

    Bill B. January 7th

    Great tut… keep ‘em coming. I LIVE FOR THIS STUFF.

    ( Reply )
  23. PG

    himangshu February 5th

    Nice and very simple, yet effective!

    TYFM! RIK
    i agree

    ( Reply )
  24. PG

    MIKE April 7th

    Hey i am a young animator and am wondering where you download this amazing movie-maker system?

    ( Reply )
  25. PG

    CgBaran Tuts April 22nd

    Good tutorial thanks

    ( Reply )
  26. PG

    MR HOLLYWOOD August 19th

    ” I would suggest, though, that instead of making 25 masks and then using wiggle to animate them, you could just use a pre-composed fractal noise as your track matte and animate the evolution. ”

    Diablo …… This sounds like a great idea. It would be great if you could do a Tutorial to show what you mean and it would be a BACK TO BACK of 2 Techniques creating the same illusion.

    ( Reply )
  27. PG

    Aboubakar August 20th

    Very good effect and simple i like it thanks ;)

    ( Reply )
  1. Arrow
    Gravatar

    Your Name
    August 20th