decorative banner

Difference Matte (PB only)


    This matte creates transparency by comparing a source layer with a difference layer, and then keying out pixels in the source layer that match both the position and color in the difference layer. Typically, it is used to key out a static background behind a moving object, which is then placed on a different background. Often the difference layer is simply a frame of background footage (before the moving object has entered the scene). For this reason, the Difference Matte Key is best used for scenes that have been shot with a stationary camera.

    Illustration with these callouts: A. The difference layer is typically a static frame of the movie before the subject enters the scene. B. The background is keyed out by comparing the static frame (difference layer) with the source layer. C. The source layer is composited onto a new background.
    A. The difference layer is typically a static frame of the movie before the subject enters the scene. B. The background is keyed out by comparing the static frame (difference layer) with the source layer. C. The source layer is composited onto a new background.

To apply the Difference Matte:

  1. Select a motion footage layer as the source layer.
  2. Find a frame in the source layer that consists only of background.
  3. Save this background frame as an image file; then import it into After Effects and add it to the composition. This is the difference layer. For more information, see Exporting a single frame of a composition. Make sure that the duration of the difference layer is at least as long as that of the source layer.
  4. Note: If there is no full-background frame in the shot, you may be able to assemble the full background by combining parts of several frames in After Effects or Adobe Photoshop. For example, you can use the Photoshop rubber stamp tool to take a sample of the background in one frame, and then paint the sample over part of the background in another frame.

  5. Turn off the display of the difference layer by clicking the Video switch in the Timeline window.
  6. Make sure that the original source layer is still selected, and then choose Effect > Keying > Difference Matte.
  7. In the Effect Controls window, choose Final Output or Matte Only from the View menu. Use the Matte Only view to check for holes in the transparency. To fill undesired holes after you complete the keying process, see Matte Choker (PB only).
  8. Select the background file from the Difference Layer menu.
  9. If the difference layer is not the same size as the source layer, choose one of the following controls from the If Layer Sizes Differ menu:
    • Center places the difference layer in the center of the source layer. If the difference layer is smaller than the source layer, the rest of the layer is filled with black.
    • Stretch to Fit stretches or shrinks the difference layer to the size of the source layer, but it may distort background images.
  10. Adjust the Matching Tolerance slider to specify the amount of transparency based on how closely colors must match between the layers. Lower values produce less transparency; higher values produce more.
  11. Adjust the Matching Softness slider to soften the edges between transparent and opaque areas. Higher values make matched pixels more transparent, but do not increase the number of matching pixels.
  12. If there are still extraneous pixels in the matte, adjust the Blur Before Difference slider. This option suppresses noise by slightly blurring both layers before making the comparison. Note that the blurring occurs only for comparison and does not blur final output.
  13. Before closing the Effect Controls window, make sure that you have selected Final Output from the View menu to ensure that After Effects renders the transparency.