| A CreativeCOW Avid tutorial |

 |
Ra-ey Saleh
Sydney, Australia
©2007 Ra-ey Saleh and Creativecow.net. All rights reserved. |
Article Focus
In this tutorial, Ra-ey Saleh will show you how even without shooting Green Screen you can replace the background of a shot whilst keeping the moving foreground undamaged. He'll use a technique called 'Difference Matting' and do it all within the Avid!..
|
What is Difference Matting? Without getting too in depth, a Difference Matte Key creates transparency information by comparing 2 images and then "keying out" pixels in the Source image that matches both the position and colour in the Difference image. Typically, it's used to key out a static background behind a moving object, which can then be placed on a different background. Often the Difference image is simply a Freeze-Frame of the Source image before the moving object has entered the scene. For this reason, the Difference Matte Key effect is best used on static shots.
If it's so simple, why doesn't everyone use them? Well, Difference Matte Keys are notoriously unpredictable. All "differences" between the two images show up, even minor lightning changes, and the results can at first look very unimpressive.
However, although Difference Matte Keys are no Green Screen replacement, if used to create a rough first pass and then touched up, they can provide a valuable time and cost saving alternative to sending it to GFX!
Let's use an example.
Import the 'Haunted House Original Shot' quicktime into a Pal project at a 1:1 video resolution with the following options selected:

Doesn't look much like a haunted house, I know.

We're gonna change all that, mainly by replacing the sky, adding lightning and a grade. However, since the kids run out of the house and across the skyline, this would normally make it near impossible to change anything, or so you might think.
First, cut the shot onto V1 of your sequence. Now Freeze the first frame of the image (I suggest with Both Fields for best quality) and cut this onto V2 for the same duration as the original shot.

Now for the Difference Matte.
There are many plug-ins that have Transfer Mode effects (also known as Blending or Apply Modes): Sapphire's Layer & Boris Continuum Complete's Composite effects are two. However, for this example, I've decided to use Profound's Transfer effect as it can be downloaded for free here.
The products are essentially Photoshop compositing Modes but for video, and provide some interesting alternatives to simply superimposing images over each other. 'Difference' is one of these Modes.
{nb. If you want to create a cool 'look' for a flashback or reconstruction, these compositing effects are perfect. Simply cut the shot you want to affect directly on top; add a Blur Effect to V1; apply the Transfer effect to V2; and select 'Hard Light' from the "Mode" options menu.}
Apply the effect to V2, then choose 'Difference' from the "Mode" menu.
The result should look something like this:

As you scrub through the sequence you can already see that, although it needs a little work, it already resembles a traditional Matte. Essentially we now need to make this look even more like a Matte. In the end, "the better the Matte, the better the Key", therefore the more time you spend cleaning this up, the better the final result will be. However, the result will never be perfect. This effect is really best suited for fast moving objects (like these kids) as we'll have little time to over-scrutinize the final composite.
Apply a Colour Correction to V2 and take out all the Saturation and increase the Contrast.

This is a good starting point and we can already see a big improvement. Now it's time to actually build the rest of our effect. We could continue to clean up our Matte, but the final composite might not require it, and we don't want to do any more work then necessary.
Create a new Video Layer (V3). Collapse V1 & V2 and move it up to V3.
Cut the 'Haunted House Original Shot' back into V2.

Now Import the 'Gothic Sky' quicktime. However, if you choose, make up your own scary skyline. I made this with Sapphire and particle Illusion.
Cut it into V1.

Now, ALT+Drop a Matte Key effect onto V3. In its Effect Editor, select the "Invert Key" option.

The result so far should look something like this:

Not bad, considering we've done no Matte correction as yet.
Create a new Video Layer (V4). Cut the 'Haunted House Original Shot' back into V4. Now apply an AniMatte effect to V4. Carefully draw around the snowy skyline and house. It should now "key through" the new gothic sky.

If you scrub through the timeline, you can see that although the effect is working, the kids get lost a little against the skyline. Our Matte, it appears, needs a little tweaking.
'Step In' to V3, back to the Collapsed track. ALT+Drop a Paint Effect onto it.
Now start to quickly paint out any obvious problems: white marks where it should be black, and vice versa.

Don't worry about anything below the skyline, as this is being AniMatted on (see the previous image).
Ultimately, as I said before, "the better the Matte, the better the Key". Make your own judgement about how long you spend cleaning up, and 'Step Out' of the effect every once in a while to make sure you're not being unnecessarily pedantic. Also, don't be too concerned about the outline of the kids. Our next job is to add some slight "blurring" to the edges of the Matte, which will help hide many problems and give it a little motion blur authenticity.
Open the Effect Editor for the Matte Key on V3. Upgrade the effect to 3D by pressing the 3D "Promote" button in the bottom right-hand corner.

Now simply turn on the 'Erode/Expand' option.

Its default is to soften the edge of the Matte, giving it an anti-aliased appearance. You can see from the Before & After close-ups below the improvement in the result.

Voilà! To really sell this in my final composite (see 'Haunted House Final' quicktime) I've added a grade, vignette, zoom out, lightning flicker and SFX.

Feel free to discuss this technique or others in the Avid forum at CreativeCOW.net.
Click here to visit Creative COW's user forums and many other articles if you got here by a direct link to this page
|