Chroma Key Basics

The completed project file and sample clips for this tutorial are available in HD (1080) and SD (480) formats.

Chroma Key is an image effects technique for compositing multiple video streams on top of each by applying a hue based masked to the foreground images. Commonly a blue or green screen backdrop is used in film production for these purposes.

Within VDMX, using the 'Chroma Mask.fs' FX on a layer will create a color-based mask that is applied within the FX-chain. Pixels in the input that are within the tolerance range are set to become transparent through the usage of alpha channels.

As a source, you can either use pre-recorded movies or a live camera for doing pre-visualization on set.

Prerequisites:

  1. Read the tutorial on Adding an FX to a Layer.

  2. Read the tutorial on Layer Composition which covers changing the composition mode.

Completed example project with 3 layers: Front, Middle, and Background.

Step 1: Add the 'Chroma Mask FX.fs' to the layer playing the blue / green screen footage to mask.

Adjust the 'keyColor' and 'range' values until the background appears black in the preview window.

Step 2: Set the 'Composition Mode' for the layer to the 'OpenGL- Over' option to prevent additive blending.

If using non-GL composition modes, use either the GLSL 'Mix' or CoreImage 'Source Atop-VV' option.

Before and after previews. Click the 'Sample' button in the color picker for the Chroma Mask FX, then click on a pixel in the pre-FX window to set the color to be masked out.

Layer Composition controls for the 'Front' layer with OpenGL- Over mode.