Composite

Stack up to four layers over a base at the base's size with blend mode, opacity, position and scale per layer.

  • Video
  • Since 0.2.0
  • composite
  • layers
  • blend

Open in TuneToys

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

Composite stacks up to four layers over a base, with blend mode, opacity, position and scale for each layer.

What it does#

The output is the size of the base. Each layer, layer1 to layer4, is placed over the base in order. Per layer, Blend picks how it combines (0 to 3), Opacity fades it, X and Y move it and Scale resizes it. Each input takes exactly one stream.

When to use it#

Use it to put a keyed camera over a backdrop, overlay text or paint, or build picture-in-picture.

Ports#

PortDirectionSignalLanes
baseInputVideo1
layer1InputVideo1
layer2InputVideo1
layer3InputVideo1
layer4InputVideo1
videoOutputVideo1

Parameters#

ParameterLabelRangeDefaultUnitScaleNotes
blend1Blend 10 to 30linearBlend mode of layer 1 over what is below. Choices: 0 Over, 1 Add, 2 Multiply, 3 Screen.
opacity1Opacity 10 to 11linearOpacity of layer 1.
x1X 1-1 to 10linearHorizontal offset of layer 1 as a fraction of the base width.
y1Y 1-1 to 10linearVertical offset of layer 1 as a fraction of the base height.
scale1Scale 10.05 to 81×logScale of layer 1 about its centre.
blend2Blend 20 to 30linearBlend mode of layer 2 over what is below. Choices: 0 Over, 1 Add, 2 Multiply, 3 Screen.
opacity2Opacity 20 to 11linearOpacity of layer 2.
x2X 2-1 to 10linearHorizontal offset of layer 2 as a fraction of the base width.
y2Y 2-1 to 10linearVertical offset of layer 2 as a fraction of the base height.
scale2Scale 20.05 to 81×logScale of layer 2 about its centre.
blend3Blend 30 to 30linearBlend mode of layer 3 over what is below. Choices: 0 Over, 1 Add, 2 Multiply, 3 Screen.
opacity3Opacity 30 to 11linearOpacity of layer 3.
x3X 3-1 to 10linearHorizontal offset of layer 3 as a fraction of the base width.
y3Y 3-1 to 10linearVertical offset of layer 3 as a fraction of the base height.
scale3Scale 30.05 to 81×logScale of layer 3 about its centre.
blend4Blend 40 to 30linearBlend mode of layer 4 over what is below. Choices: 0 Over, 1 Add, 2 Multiply, 3 Screen.
opacity4Opacity 40 to 11linearOpacity of layer 4.
x4X 4-1 to 10linearHorizontal offset of layer 4 as a fraction of the base width.
y4Y 4-1 to 10linearVertical offset of layer 4 as a fraction of the base height.
scale4Scale 40.05 to 81×logScale of layer 4 about its centre.

Blend 1 (blend1)#

Blend mode of layer 1, 0 to 3.

Opacity 1 (opacity1)#

Opacity of layer 1.

X 1 (x1)#

Horizontal position of layer 1, -1 to 1.

Y 1 (y1)#

Vertical position of layer 1, -1 to 1.

Scale 1 (scale1)#

Size of layer 1, logarithmic.

Blend 2 (blend2)#

Blend mode of layer 2.

Opacity 2 (opacity2)#

Opacity of layer 2.

X 2 (x2)#

Horizontal position of layer 2.

Y 2 (y2)#

Vertical position of layer 2.

Scale 2 (scale2)#

Size of layer 2.

Blend 3 (blend3)#

Blend mode of layer 3.

Opacity 3 (opacity3)#

Opacity of layer 3.

X 3 (x3)#

Horizontal position of layer 3.

Y 3 (y3)#

Vertical position of layer 3.

Scale 3 (scale3)#

Size of layer 3.

Blend 4 (blend4)#

Blend mode of layer 4.

Opacity 4 (opacity4)#

Opacity of layer 4.

X 4 (x4)#

Horizontal position of layer 4.

Y 4 (y4)#

Vertical position of layer 4.

Scale 4 (scale4)#

Size of layer 4.

Tips#

  • Unconnected layers are ignored.
  • Use Transform to prepare a layer's size first.
  • 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#

Chroma key, Video crossfade, 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. Stack two layers

intermediate Teaches: opacity1, x1, y1, scale1, blend1, opacity2

A camera base with a text and a paint layer on top.

Patch: Camera video output connected to Composite base input. Text layer video output connected to Composite layer1 input. Paint surface video output connected to Composite layer2 input.
Connections as text
  • Camera video output connected to Composite base input
  • Text layer video output connected to Composite layer1 input
  • Paint surface video output connected to Composite layer2 input
  • The output is the size of the base.
  • Layer 1 is the text; each layer has its own blend, opacity, position and scale.
Frame preview: Stack two layersFrame “Stack two layers” with 8 elements: knob Blend 1, text heading, knob Opacity 1, knob Opacity 2, knob Scale 1, screen Picture, knob X 1, knob Y 1.0Blend 1STACK TWO LAYERS1Opacity 11Opacity 21 ×Scale 1screen0X 10Y 1
Frame preview (static). Controls show their default values.

Open in TuneToys

  • Chroma key Turn one colour transparent with tolerance, softness and spill suppression: the green screen.
  • Video crossfade Blend two streams with one mix control.
  • 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