Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Apple > Operating Systems

  • Print
  • + Share This
This chapter is from the book Professional Keying in Post

Professional Keying in Post

There are several ways to get the job done when it comes to keying. The “right” method really depends on a variety of factors including acquisition format, lighting approach, subject matter, and personal taste. For most of you reading this book, you will need to explore the many different options available and choose the ones that work best for you. The workflows we cover here are meant to serve as an inspiration but are no means right for every situation.

Keying in Final Cut Pro

We find that Final Cut Pro offers a robust chroma keyer, and that it’s well suited for the initial edit. You can get acceptable results with well-shot footage, and the composites you create work well for the rough-cut of the video. We use Final Cut Pro’s keyer during the initial edit stage to work out timing issues. Once we have client approval, we then move to a compositing application like Motion or After Effects.

Getting started

Keying with Final Cut Pro involves a few steps to get the most professional results. Some users skip right to the Chroma Keyer filter and only use the most basic setting because they intend to finish the key elsewhere and only want a proxy effect. We believe that the few extra seconds it takes to get it right are worth it, even if you intend to do the final keying with Motion or After Effects.

  1. If you haven’t done so already, copy the Chapter_05_Media folder from the DVD to a local hard drive. Then open the folder and double-click the file 01_Keying_FCP.fcp. A Final Cut Pro project opens with two sequences.
  2. Double-click the sequence 01_Key Start to load it into the Canvas and Timeline windows. Select the clip watch by clicking it in the Timeline.
  3. Choose Effects > Video Filters > Key > Color Smoothing - 4:2:2. This effect reduces diagonal banding that can occur in areas of high contrast. The footage you are using is DVCPRO-HD, which uses 4:2:2 color sampling.
  4. Choose Effects > Video Filters > Key > Chroma Keyer. Double-click the clip in the Timeline to load it into the Viewer window. In the Filters tab, click the Visual button to get easier-to-use controls.

Pulling an initial key

Once the initial color to key is selected, you can refine it by adjusting the color value, saturation, and luma ranges independently for greater accuracy. This type of keyer is often called an HSL key.

  1. In the Chroma Keyer tab, click once on the Select Color eyedropper to specify a color to key (Figure 5.12).
  2. Figure 5.12 Click the eyedropper before selecting the color to key.

  3. Click in the Canvas on a green area close to the subject’s hair (Figure 5.13). An initial selection of Hue, Saturation, and Luma is chosen in the Chroma Keyer tab (Figure 5.14).
  4. Figure 5.13 Be sure to select a green that is representative of the background, avoiding areas with shadows or color spill.

    Figure 5.14 Here is the color from the initial selection shown in the Chroma Keyer tab.

  5. Click on the Select Color eyedropper again. Hold down the Shift key and click and drag throughout the green backdrop. This increases the range of colors to be keyed out and expands the keyed-out area. This works well but must be done after you’ve made an initial selection; otherwise, it won’t work.
  6. Drag the Range Control sliders for Color, Saturation, and Luma to fine-tune the key (Figure 5.15). For this footage, start by dragging the top sliders for Color, Saturation, and Luma to the right to affect a broader area. Drag the sliders outward to include more or inward to include less in the selection.
  7. Figure 5.15 Fine-tune the key by dragging the sliders.

  8. To make it easier to see your keying results, right-click on the background layer in the Timeline (Ruins.tif) and deselect the Clip Enable option.
  9. Drag the bottom handles gently for each of the three values to improve your initial key and soften the transition between keyed and non-keyed colors (Figure 5.16).
  10. Figure 5.16 Improve the key by dragging the bottom handles. Spread the handles further apart to refine the edges and smooth the transition between keyed and non-keyed areas.

Refining the key

Once a good key has been achieved, you can refine it in a few steps. The Chroma Keyer filter lets you refine the edge as well as color spill for a better key.

  1. Drag the Softening slider to the right a short distance to blur the edges of the matte.
  2. Drag the Edge Thin slider to the right to “eat away” the green fringe (often referred to as choking the matte).
  3. Adjust the top and bottom sliders for Hue, Saturation, and Luma as needed to refine the key (Figure 5.17).
  4. Figure 5.17 Keying often involves some back and forth to get things “just right.”

  5. Right-click on the bottommost layer (Ruins.tif) and choose Clip Enable.
  6. Drag the Enhance slider slowly to the right to remove any green spill (going too far will add magenta to the edge).
  7. Choose Effects > Video Filters > Matte > Matte Choker to apply a matte choker effect. This effect can be used to refine the edges of the matte creating the key.
  8. Switch to the Filters tab and choose a negative value for Edge Thin and a positive value for Edge Feather to restore the aggressive edge loss caused by the Chroma Keyer effect (Figure 5.18).
  9. Figure 5.18 The Matte Choker effect can help clean up the edges of your key. Adjust Edge Thin and Edge Feather for best results.

  10. Choose Effects > Video Filters > Key > Spill Suppressor – Green. Adjust its Amount slider to taste to remove any remaining green spill on the image (Figure 5.19).
  11. Figure 5.19 Suppressing spill can remove green cast from the subject (usually seen on hair and shoulders).

  12. Tweak the individual sliders in the Chroma Keyer and Matte Choker effects as needed to get your best result.

Tweaking the composite

You’re almost done with your key. The only thing missing is balancing the foreground image to the background image. It’s often necessary to adjust both your images to make the foreground and background look as if they were shot together. Possible adjustments include color correction and blurring filters. Even with a successful key, attention to the little details is what makes a composite look like a finished shot.

  1. Select the bottommost layer in the Timeline window (Ruins.tif).
  2. Choose Effects > Video Filters > Blur > Defocus. Depending on the amount of RAM on your system, you may get an error message indicating that scaling has occurred. If so, click OK to limit the effect.
  3. Double-click the bottommost layer to load it into the Viewer. Adjust the Defocus filter to taste in the Filters tab (Figure 5.20).
  4. Figure 5.20 The Defocus filter can soften the background and help to simulate depth of field.

Your key is now complete. There’s one more shot in the Timeline that you can practice with. Use the techniques you’ve learned so far and practice keying the additional shot. When you are ready, continue with the next exercise.

Keying in After Effects

In our workflows, it’s After Effects we turn to for the best results when keying. While there are several powerful tools that allow for accurate mask creation and refinement, there’s one workhorse in the bunch that does nearly all the work—Keylight.

  1. In Final Cut Pro, mark an In and Out point for the range you’d like to export in a sequence.
  2. Choose File > Export > XML. In the dialog that opens, choose Apple XML Interchange Format, version 4 (or later) and click OK.
  3. Specify a location for the XML file (such as your media drive) and click OK.
  4. Launch Premiere Pro and create a new project that most closely matches the video format you’ve been using.
  5. In Premiere Pro, choose File > Import. Navigate to the XML file you created and click Import. Premiere Pro creates a sequence and adds the media and a report to the project.
  6. Choose File > Save and save the project to your media drive.
  7. Launch After Effects and choose File > Import > Adobe Premiere Pro Project. Select the recently created Premiere Pro project and click Open. Click OK in the Premiere Pro Importer dialog. All the media (with handles) is now imported into the After Effects project.
  8. Choose File > Save and capture the new project. You can now begin working. All the media is still referenced on your drive with no duplication of assets.

The technology used in Keylight uses a core algorithm written by the Computer Film Company. This technology has been used on numerous feature films including Harry Potter, Mission Impossible, and Sweeney Todd. Keylight has won the Academy Award for Technical Excellence and is a one-stop shop for keying, despill, and color correction.

When you apply Keylight to a footage layer, you choose a color to key out. The effect then does two things: First, it erases all the pixels that match the color. Second, it removes that color spill from other pixels. So if you select green, it will remove the backdrop and greatly reduce any green reflections on the foreground. Keylight is relatively easy to use (once you understand its options). It is also quite adept at handling reflections, semitransparent areas, and hair.

Getting started

The Keylight plug-in can be a bit intimidating since it has nearly 60 parameters. The good news is that there are only a few main controls—the rest are just used for fine-tuning. Let’s start with some basic material that needs to be keyed.

  1. If you haven’t done so already, copy the Chapter_05_Media folder from the DVD to a local hard drive. Then open the folder and double-click the file 02_Keying_AE.aep.
  2. In the Project panel, double-click the composition 01_Key Start to load it. There are two clips loaded into a Timeline.
  3. Select track 1 in the Timeline by clicking on it once; then hold down the Shift key and click to add track 2 to the selection (Figure 5.21).
  4. Figure 5.21 Add track 2 to the selection This will allow you to apply the keying effect to both clips at once.

  5. Choose Effect > Keying > Keylight to apply the Keylight plug-in. Nothing appears to happen.
  6. In the Effect Controls Viewer click the menu and choose the topmost layer called 01_Key Start • watch.mov (Figure 5.22).
  7. Figure 5.22 Choose this option to begin the keying process.

  8. Move the Current Time Indicator to the start of the composition by pressing the Home key or dragging. You are now ready to start the keying process.

Pulling an initial key

Keying is often a multistep process. You will find yourself finessing and refining to get the best results. But the most dramatic change starts with a single click. The first thing you’ll do when using Keylight is choose the Screen Colour you’d like to remove (yes, the plug-in developers are British). The Screen Colour is the color you want removed from the background that the color Keylight will despill from the rest of the scene.

  1. Click the eyedropper next to Screen Colour to activate the selection eyedropper (Figure 5.23, left). Click just over the shoulder of the subject. You want to click close to the person to remove the green areas closest to the subject (Figure 5.23, right). Clicking close ensures that the edges around soft areas (such as hair) key the best.
  2. At first glance, the key looks “perfect.” It’s not. Close examination reveals that the image has extra transparency and some spill that needs to be corrected. You can often see this by viewing the key over a transparent background or by playing they key in realtime and looking for “dancing” pixels.

    Figure 5.23 An accurate click is important to get a good key. Clicking near the hair helps create better edge detail.

  3. In the Effects panel, click the menu next to View and switch to Screen Matte (Figure 5.24). This lets you see the grayscale matte that Keylight uses to create transparency. The matte indicates transparent areas in black, opaque areas in white, and partially transparent areas in gray. Close examination of the matte indicates that the background has not been completely removed, and that the shirt, face, and hair are showing undesirable amounts of transparency. (Figure 5.25).
  4. Figure 5.24 Be sure to switch to Screen Matte view to check for unintended holes or noise in the matte.

    Figure 5.25 The background has some noise in it, which is indicated by gray pixels in the black areas. More visible is light gray noise in the white areas of the matte where the person is.

  5. Increase the Screen Gain parameter to push the background toward a clean black plate. For this first shot, a value of 115.0 works well. Some users alternately will use the Clip Black slider discussed in the next section for similar results.
  6. Change the Screen Pre-blur to a value of 1.0 to slightly soften the edges of the generated matte. Avoid using a high value or halos will occur.

Cleaning up the matte

For a believable key, it’s good to have some gray pixels around the edge of the subject (so hairs and other semitransparent elements can blend into the background). The background surrounding the keyed subject, however, should be solid black, and the keyed subject should be solid white. Currently, the background is in pretty good shape, but the foreground can really use some work.

  1. Click the disclosure triangle next to Screen Matte to reveal several controls that can be used to fix matte problems (Figure 5.26).
  2. Figure 5.26 Be sure to access the Screen Matte controls for more precision.

    You can use the following sliders to refine the mask:

    • Clip Black. This makes the blacks in the matte darker.
    • Clip White. This makes the white areas in the matte whiter. Be careful with both clip controls to not overdo it and ruin the edges of your foreground.
    • Clip Rollback. This allows you to undo clipping and bring the edges back.
    • Screen Shrink/Grow. This control can contract or expand the matte.
    • Screen Softness. This softens the generated matte.
    • Screen Despot White. This parameter removes white specks that are inside a generally black background.
    • Screen Despot Black. This parameter removes black specks that are inside a generally white foreground.
  3. Increase Clip Black to 6.0 to clean up the transparency.
  4. Lower Clip White to 84.0 to remove most of the “holes” in the matte (Figure 5.27).
  5. Figure 5.27 A clean matte will show an even black for transparent areas with white for opaque areas.

  6. Adjust the Clip Rollback to 3.0 to restore edge detail.
  7. Set the Screen Softness to 1.0 to remove fringe at the edges, and then set Screen Shrink/Grow to -2.0.
  8. Adjust Screen Despot Black to 4.0. You may need to resize the Effect Controls panel to see the full name. Click in the area between the Effects and Composition panels and drag to resize.
  9. Click the View menu and choose Final Result to see your keyed footage (Figure 5.28).
  10. Figure 5.28 The final key after adjusting several important but subtle parameters.

Correcting color

After you’ve keyed the background, you’ll usually need to adjust the foreground colors so they properly match the colors of your new background. Fortunately, Keylight offers two sets of controls to fix these issues:

  • Foreground Colour Correction. This process affects the majority of the person or object left behind after Keylight has removed the background.
  • Edge Colour Correction. This step modifies a thin band of pixels running around the person or object. This is where the majority of color spill occurs from the background reflected on the subject. This is a critical area to tweak when trying to make a believable composite.
  1. In the Effects panel, click the disclosure triangle next to Foreground Colour Correction, and then select the Enable Colour Correction check box.
  2. Increase the Saturation slider to 115 to boost the color in the foreground to match the richly saturated background.
  3. Adjust the Contrast and Brightness to match the foreground subject to the background plate. For this image try a Contrast setting of 6.0 and a Brightness setting of -10.0.
  4. Click the disclosure triangle next to the Colour Balance Wheel. This allows you to adjust the white balance of the image and tint the foreground to better match the color temperature of the background. Slowly drag the x on the wheel to the left. Experiment with different positions until the color matches well (Figure 5.29).
  5. Figure 5.29 Keylight offers a color wheel to help with spill. You can drag toward a warmer color like orange to warm the scene or toward blue to cool it.

  6. Additionally, the Edge Hardness and Edge Softness parameters are useful. Edge Hardness controls how much the edge color correction merges into the main foreground color correction, whereas Edge Softness blurs the edges.
  7. Scroll down in the Effects panel and click the disclosure triangle next to Edge Colour Correction. Select the Enable Edge Colour Correction check box.
  8. Set the Edge Grow to 10.0, Saturation to 70.0, and Brightness to -5.0 to reduce the richness of color at the edges (the results will be subtle).
  9. Set Edge Colour Suppression to Suppress Green, and then open the Colour Balancing area and set Saturation to -2.0 to further remove color from the edges (Figure 5.30).
  10. Figure 5.30 Adding Edge Colour Correction helps blend the edges with the background plate.

Adjusting edges

Sometimes your image will need a slight crop or reposition due to its edges. It’s essential that you carefully examine the edges of the image when keying to look for undesired transparency or black fringe. The footage layer you are working with has a problem with the bottom edge (the second shot in the Timeline has a rough edge on the right side as well).

Let’s start with the stray transparency at the bottom of the frame. You need to nudge the layer down slightly to hide the soft bottom edge (Figure 5.31).

Figure 5.31 The bottom edge is a bit soft and should be hidden for a cleaner composite.

  1. Select the layer watch.mov in the Timeline and press P to access the Position property.
  2. Click the Choose grid and guide options button and choose the Title/Action Safe option to view guides to help with composition and framing (Figure 5.32).
  3. Figure 5.32 Using Action Safe guides can help you judge composition framing for broadcast purposes.

  4. Set the Y value to 430.0 to reposition the footage in the Composition panel. For best results, type the number into the entry field. A decimal point value often results from dragging, which can lead to subpixel resampling and image softness (Figure 5.33).
  5. Figure 5.33 The bottom edge now appears clean.

    The bottom edge is fixed, and the composition of the shot looks good. But closer examination reveals that the background is too in focus compared to the foreground.

  6. Select layer 3 in the Timeline panel and choose Effect > Blur > Fast Blur.
  7. In the Effects panel, set Blurriness to a higher value (in this case try 7.0). The end result is a more believable composite (Figure 5.34).
  8. Figure 5.34 Blurring the background makes for a more believable composite.

Your key is now complete. There’s one more shot in the current Timeline that you can practice with. Use the techniques you’ve learned so far and practice keying the additional shot. When you are ready, continue with the lesson.

  • + Share This
  • 🔖 Save To Your Account