Advertisement from Google AdSense

QUESTION: I need to take footage of a subject against a pitch black background and create a luma matte from this. If I mess with the levels, I will always end up with a thin black line around whatever I am transferring into the finished matte. 

To answer the question you asked, use a matte choker, such as "Simple Choker", plus blur, and if needed, masks. Mocha can be very helpful here.

In CS5 and later, look at using Rotobrushes and refine matte - though personally I find these new tools frustrating to use:

To answer the question you didn't ask - which I am assuming is "how to get a good comp with black screen".

Black screen can be the ideal background for some elements intended for compositing - for instance, transparent elements such as grey smoke, water, or steam can be great against black screen as you can often composite them by simply using the additive transfer mode ("add" when working in linear 32-bit space, or "screen" in non-linear gamma-encoded space).

Black screen can also bee useful for solid objects that have sufficient lighting and limited dark areas. But a typical mistake here is to try and use the luma key plugin, or to just set a layer with levels clipped and use it to luma key.

INSTEAD, for solid objects try the hold-out matte approach:


1) Work in 32 bit linear color space (gamma 1.0).

2) Create a comp with your background plate.

3) On top of your background plate, place TWO layers of the black screen element. Parent the lower layer to the upper one, so that any transforms made on the upper layer are duplicated.

4) Name the middle black screen layer "Holdout Matte", and place the following effects, in this order:

Top effect: Levels Individual Controls — name it "invert and matte"

Middle effect: Blur — name it "matte soften"

Bottom effect: Levels — name it "matte choke"

5) Adjust the middle black screen layer as so:

* Set the top effect, (Levels named "invert/matte"), so that the black-screen area is at 1.0 value (32 bit mode white). Adjust so that the brightest area of the subject is 0.0 (black). To do this set the output BLACK level to 1.0, and the output white level to 0.0. Set "clip" to ON for both black and white.

In the timeline, option click the stop watch for input black and input white levels. Then using the pickwhip, connect the input white level to the input black level, and in the resulting expression  amend it with +0.05 to provide a small spread between input white and black. then adjust the input black level until the black screen is clipped to 1.0 white, and you are left with a black solid for the subject.

* *Optionally* drop in a TINT effect to force the clip greyscale *or* use the pickwhip to connect the input white/black for each of the RGB channels, and clip each color independently.

*Optionally 2* instead of the pickwhip directly connecting the Input white/black, run it through an expression control so that the width between white and black can be varied.

* Set the middle effect, (Blur "matte soften") effect to 10 pixels initially.

* Leave the bottom effect  (Levels "matte choke") alone for now.

6) Set this middle black screen layer "Holdout Matte" to MULTIPLY transfer mode.This will put a solid black area on the background plate in the area of the foreground subject, while the rest of the BG plate should be unaffected. (Multiplying by 1.0 white has no effect).

7) For the TOP black-screen layer (the foreground element): set it to ADD transfer mode. If necessary, add a garbage mask, and a levels control and/or curves to dial this in to match and comp properly to the background plate.

8) Now the magic touch — gamma blur — Adjust the GAMMA (only) on the middle black screen layer "Holdout Matte"'s  bottom effect (Levels "matte choke"), to adjust and get a clean edge. This gamma control will work hand in hand with the blur. The blur will adjust the spread of the cutout matte, and the bottom levels control will adjust the choke amount and sharpness. Adjust the blur pixels in association with the bottom effect levels gamma, to get the matte edge that you like.

Since you are ADDing the topmost layer, you can adjust edge transparency without clipping the edge of the foreground element. The edge being slightly transparent will also have a natural edge wrap.

If your subject is a combination of solid and transparent objects, you will need to add a mask to the middle black-screen layer so that the areas of transparency do to have a black solid multiply on the base plate.

To adjust the density of the transparent portions, duplicate the middle layer named MATTE, and name this layer "Transparency density", and invert the same mask on this layer to set all but the transparency region to white. Adjusting the opacity of this layer will adjust the density of the transparency.

It should be obvious that black-screen will not work well when the the subject has very dark areas that are within clipping distance of the black screen area. Also, this method tends to break down with 8 bit images. Ideally, you want to be capturing at least in 10 bit LOG, or 12 or 16 bit linear (RAW), with the black-screen exposed at least a stop below the darkest values in the subject.

QUESTION: “So do you typically use this method when keying out such elements as smoke or water? We rarely use black background, but occasionally for such elements. “

Smoke or steam when backlit and bright, such that it would be served well by additive transfer, or additive transfer *combined* with multiply. You need the MULT layer to reduce brightness and transparency.

Also, bright elements are especially good for black screen - sparks for instance add especially well in 32-bit linear space. In additive transfer these kinds of elements are essentially self-keying.

I'm setting up to do this right now to augment a shot with a cutting torch/sparks. (An acetylene torch could not be used too close to the actors on the day for safety.)

So, I'm going to shoot a real torch element against duvetyne, cutting sheet metal that has been painted flat black. The sheet metal will be oriented close to the orientation of the steel being cut in the actual scene, and shot as a static lockdown (the nature of the shot should allow cheating perspective, even though the original camera was not moving as nodal). Then tracked and comped into the scene using ADD mode.

The *really cool* thing about working in 32-bit linear is the ability to "ADD" and also combine ADD and MULTIPLY to really dial things "into" a shot.

Still, I don't mean in anyway to imply that black-screen replaces green/blue/red - it is a separate tool, with its own quirks and "usefulness curve". But the next time you need to comp backlit steam, or bright things like sparks and flames, or solid objects with low contrast I think you'll be happily surprised at how quickly you can dial in a comp.


Note also the "gamma/blur" technique I mentioned above can be used in other color key situations.

Instead of doing the actual comping inside the keying plug-in (keylight, primatte, etc), just use the plug in to create the matte(s), and then use gamma/blur, and COLOR/ADD/MULT transfer modes (and using precomps to pre-mult etc) for bringing it all in together. While this is more complicated than using a keying plugin on its own, the level of control you gain, and quality of the resultant comp is often worth it. 

Side note: IMO, Ultimatte Advantedge was the only plug-in that really worked well as an "all in one" comping solution, but sadly it is no longer supported in AE, and even if it was, it was *DOG* slow to render. It does live on in Nuke. Ultimatte is now focused on their hardware solutions.


From the techniques noted above, it might seem that you can create your own keying solution using several of the more basic plug-ins (i.e. levels, curves, blur, shift channels). And indeed you can. For instance if you have a green screen element, you can make that into a hold-out matte by taking the blue channel and assigning it to all channels, then the effects stack used as above for the "holdout matte" layer. 

This will be the subject of another tutorial.

This article was originally written circa 2012, but updated July of 2018

Advertisement from Google AdSense

Help | Legal | Contact Us

Copyright © 2012-2018. All Rights Reserved.