Chroma key

Turn one colour transparent with tolerance, softness and spill suppression: the green screen.

  • Video
  • Since 0.2.0
  • chroma key
  • green screen
  • effect

Open in TuneToys

Chroma key as the Patch draws it, at default values: inlets on the left, outlets on the right.

Chroma key turns one colour transparent: the green screen.

What it does#

Hue picks the colour to remove, 120 for green and 240 for blue. Saturation sets how colourful a pixel must be to count, Tolerance how far from the hue still counts, Softness how gently the edge fades and Spill how much key colour is removed from what remains. The output keeps an alpha channel; place it as a layer of a Composite. It processes every stream of the input at that stream's size and keeps the stream count.

When to use it#

Use it to put a person in front of a backdrop image or video.

Ports#

PortDirectionSignalLanes
videoInputVideoInferred from the cable
videoOutputVideoInferred from the cable

Parameters#

ParameterLabelRangeDefaultUnitScaleNotes
hueKey hue0 to 360120°linearHue of the colour to remove; 120 is green.
saturationSaturation floor0 to 10.3linearPixels less saturated than this are never keyed.
toleranceTolerance0 to 18025°linearHue distance that is fully transparent.
softnessSoftness0 to 9015°linearExtra hue distance over which transparency fades in.
spillSpill0 to 10.5linearHow strongly the key colour is desaturated at the edges.

Key hue (hue)#

Colour to remove, in degrees around the colour wheel.

Saturation floor (saturation)#

Minimum colour strength a pixel needs to be keyed.

Tolerance (tolerance)#

How far from the hue, in degrees, still counts as the key colour.

Softness (softness)#

Width of the soft edge, in degrees.

Spill (spill)#

How much of the key colour is neutralised on what remains.

Tips#

  • Light the screen evenly; a clean key needs little Tolerance.
  • Raise Spill if the subject has a green fringe.
  • Video needs the browser's WebGPU video engine. The Player and exports do not run video yet and report it unavailable. To see a video output, bind a live Screen in the Frame to it.

See also#

Composite, Color, Image, Video, Control lanes.

Help patches

Each help patch is an ordinary Toy that teaches one idea. The diagram shows the Patch; the preview shows its Frame. Open it in TuneToys to play and edit it.

1. Green room

intermediate Teaches: hue, saturation, tolerance, softness, spill, video

Camera keyed over an image backdrop.

Patch: Camera video output connected to Chroma key video input. Image video output connected to Composite base input. Chroma key video output connected to Composite layer1 input.
Connections as text
  • Camera video output connected to Chroma key video input
  • Image video output connected to Composite base input
  • Chroma key video output connected to Composite layer1 input
  • Hue 120 is green; set 240 for a blue screen.
  • The keyed camera is the top layer of the composite over the backdrop image.
Frame preview: Green roomFrame “Green room” with 7 elements: text heading, knob Key hue, knob Saturation floor, screen Picture, knob Softness, knob Spill, knob Tolerance.GREEN ROOM120 °Key hue0.3Saturation floorscreen15 °Softness0.5Spill25 °Tolerance
Frame preview (static). Controls show their default values.

Open in TuneToys

  • Composite Stack up to four layers over a base at the base's size with blend mode, opacity, position and scale per layer.
  • Color Adjust brightness, contrast, saturation, hue, gamma and warmth, or invert the picture.
  • Image A declared image asset as a still video stream, for logos, backgrounds and keys.

Edit this page on GitHub

esc

↑ ↓ move↩ open⌘↩ new tabesc close