Typical Keying Challenges
As you must know by now, because I've seized every opportunity thus far to drill it into your head, the number one solution to most matte problems is to break the image being matted into multiple sections rather than trying to get one matte in one pass. You can divide the matte as follows:
- Core and edge matte (hard and soft matte)
- Holdout masks for particular areas of the frame (useful if lighting varies greatly within the frame, or if one area contains a particularly challenging element, such as hair or motion blur)
- Temporal split (if light conditions change as the shot progresses)
All other tricks fall short if you're not willing to take the trouble to do this. And now for some more bad news.
No matter how advanced and well paid you may be, your time is likely to be far cheaper than that of a full crew on set. Shocking, I know, but that means that you'll have the opportunity to fix things in post that should have been handled differently on set. You could call it job security, but that sounds cynical. However you think of it, it's bound to be part of your job.
If you're fortunate enough to be supervising the effects shoot (I recommend it for the craft services alone), you can do all sorts of things to ensure that the footage will key successfully later.
A hard cyclorama, or cyc (pronounced like "psych"), painted a uniform key color is far preferable to a temporary cloth background. If you can't rent a stage that has one, the next best thing might be to invest in a roll of floor covering and paint it, to get the smooth transition from floor to wall, as in Figure 32 (assuming that the floor is in shot). Regarding the floor, don't let anyone walk across it in street shoes, which will quickly contaminate it with very visible dust. There are white shoe-cover booties often used specifically to avoid this issue, but it can be a losing battle.
Figure 32 On a set with no hard cyclorama, you can create the effect of one—the curve where the wall meets the floor—using bluescreen cloth instead. It doesn't behave as well (note the hotspot on the curve), but it will certainly do in a pinch and is much preferable to removing the seam caused by the corner between the wall and floor. (Image courtesy of Tim Fink Events and Media.)
Assuming that you begin with a correct-colored, footprint-free background with as few seams and other variations as possible, the most important concern is to light it correctly, balancing the foreground and background lighting.
Of course, this job is best left to a professional, and any kind of recommendations for a physical lighting setup are beyond the scope of this article. But, hey, you're going to spend more time examining this footage than anyone else does, so here are a few things to keep in mind as the on-set effects supervisor:
- Light levels on the foreground and background should match. A spot light meter tells you whether they do.
- Diffuse lights are great for the background (often a set of large 1 K, 2 K, or 5 K lights with a silk sock covering them), but fluorescent lights will do in a pinch. With fluorescents, you just need more instruments to light the same space. Kino Flo lights are a popular option as well (see Figure 33).
Figure 33 Diffuse white lighting that causes no hotspots in the background is ideal.
- Maintain space between the foreground and background. Ten feet is ideal.
- Avoid dark unwanted shadows like Indiana Jones avoids snakes, but by all means light for shadows if you can get them and the floor is clean. Note that this technique works only when the final shot also has a flat floor.
- Shoot exteriors outside if possible, using portable backgrounds such as solid-color cloths and carpets. You lose the controlled environment of the studio, but the quality of broad daylight can be difficult and expensive to re-create on set. There's just no key light as big as the sun.
- Record as close to uncompressed as possible. Even many low-end HD cameras allow you to record uncompressed directly to a disk array and avoid the pitfalls of heavily compressed tape formats.
If the setup permits, bring along a laptop with After Effects on it and with some representation of the scene into which the footage you're taking is going to be keyed. This type of preparation can be enormously helpful not only to you but to the gaffer and director of photography, to give them an idea of where to focus their efforts.
Finally, once the lighting has been finalized and before action is called on the shot, ask the camera operator to shoot a few frames of clean plate—the background with no foreground characters or objects to be keyed out later. There are all sorts of ways to make use of this footage, and it's easy to forget. If you did forget, try to get the frames at the end of the setup, or the end of the day.
Specific tools are available to help you manipulate any matte that needs help. You may simply need to loosen or choke a matte edge.
Minimax is powerful, but not as precise as Matte Choker or Simple Choker. It operates in whole-pixel increments to choke and spread pixel values, so the result isn't necessarily subtle. It provides a quick way to spread or choke pixel data, particularly without alpha channel information (since it can also operate on individual channels of luminance).
Simple Choker allows you to choke or spread alpha channel data (via a positive or negative number, respectively) at the sub-pixel level (use decimal values). That's all it does. If you push it hard, it behaves better than the Screen Shrink/Grow control in Keylight, which starts to look blobby. Matte Choker seems more deluxe than Simple Choker (it's not stuck with that "Simple" label), but it merely adds softness controls that can just complicate a bad key. Don't be afraid to "settle" for Simple Choker: It's no monkey wrench.
Earlier in this article I introduced the three-pass method for deriving a matte; this is one way to derive an edge matte when it's specifically the edge pixels you need to select for adjustment. However, the simplest method to get an edge matte is probably as follows:
- Apply Shift Channels. Set Take Alpha From to Full On and all three color channels to Alpha.
- Apply Find Edges (often mistaken for a useless psychedelic effect because, as with Photoshop, it appears in the Stylize menu). Check the Invert box (see Figure 34).
Figure 34 You can use this selection to blur the background and foreground together along the edge via an adjustment layer. The bottom edge is included in the matte; don't let this bite you if your frame has no padding (non-visible area at the edge of frame).
Minimax is useful to help choke or spread this edge matte. The default setting under Operation in this effect is Maximum, which spreads the white edge pixels by the amount specified in the Radius setting. Minimum chokes the edge in the same manner. If the result appears a little crude, an additional Fast Blur will soften it (see Figure 35).
Figure 35 Need thicker, softer edges? A quick Minimax set to the default Maximum allows you to specify a Radius by which the white area will grow. If the result looks a little chunky, a quick Fast Blur will soften it back.
- Apply the result via a luma matte to an adjustment layer. You shouldn't need to precompose before doing so.
Now what? Fast Blur will soften the blend area between the foreground and background, another way around a chewy matte that doesn't harm the overall image. A Levels adjustment will darken or brighten the composited edge to blend it better. Hue/Saturation can be used to desaturate the edge, similar to using a gray edge-replacement color in Keylight.
Holes can appear in solid areas of a matte: in the background, because of uneven lighting, seams, dirt on the floor; in the foreground, usually because of reflections from the background (especially the floor). No built-in tool in After Effects deals with these difficulties procedurally, but there's a great third-party tool called Alpha Cleaner, part of the Key Correct set (formerly Miracle Alpha Cleaner in Composite Wizard). Because it's an automated solution, it will occasionally fill holes that should remain unfilled, such as the little triangular gap that can open up under outstretched arms (see Figure 36).
Thus, matte holes present a situation in which you may have to rotoscope. Often it's not as bad as you think it will be. The painstaking part of keying is defining the edge, and holes can often be fixed using crude masks or by tracking in paint strokes.
Figure 36 An automated solution, such as Alpha Cleaner (part of the Key Correct Pro pack), fills holes in the foreground matte but may have side effects, closing needed holes such as this tiny gap under the arm.
Visible fringing around the edge of a feathered matte can appear when a matte is applied via a track matte. Whether to avoid Keylight's heavy processing of spill and grain or to build a multilayer matte, you have seen a few reasons to work this way.
One solution to fringing is hidden away in the Channel menu. Remove Color Matting (a difficult name to remember, which could instead be "un-premultiply") is designed specifically to remove background color from premultiplied edges.
Remove Color Matting uses black as the default Background Color (usually the right setting), and this is the only user-adjustable parameter in this effect. You can instead use the eyedropper to sample a background color. If the fringing is bright-colored, a white or gray background may have been premultiplied.
Color spill need not be a big deal. If you're not happy with the spill suppression in Keylight (or another keyer), you can apply the matte as an alpha track matte to the source footage and pursue alternative options.
Sometimes the Spill Suppressor tool that's included with After Effects will do the trick. It uses a simple channel-multiplication formula to pull the background color out of the foreground pixels. All you need to do is select a sample from the background color (you can even copy your original choice of screen color from Keylight, but it mostly matters whether you choose blue or green) and leave the setting at 100%.
If even Spill Suppressor has undesirable side effects, then it may be advisable to apply Hue/Saturation and target the specific hue that's causing problems, either desaturating or shifting it. Select the color of the spill under Channel Control—Blues, for example. (For some reason they're all plural.)
Channel Range contains two color spectrums with a set of controls between them (see Figure 37). These settings control the actual range of a given hue. The inner hash marks control the range affected by the controls below; the region between those and the outer, triangular markers is the threshold area.
Figure 37 The hash marks and triangles under the upper gradient of the Channel Range control the core and threshold of the affected hue range; the result is reflected in the lower gradient. This is often an effective method to remove spill.
For the best result, turn off Keylight or any other matte operations and work directly with the plate. Set the Saturation for the channel (Blue Saturation or Green Saturation) to -100%. Move the inner and outer hash marks outward until the background is completely gray; the foreground inside the edges should appear unaffected. Re-enable the matte, now without spill.