Transform

Move, scale, rotate, crop and mirror a stream, and set the output size. Also the resize node.

  • Video
  • Since 0.2.0
  • transform
  • resize
  • crop

Open in TuneToys

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

Transform moves, scales, rotates, crops and mirrors a stream, and sets its output size.

What it does#

Position, scale, rotation and crop change how the picture sits inside the frame. Width and Height set the output size; 0 keeps the input size, so it is also the resize node. It processes every stream of the input at that stream's size and keeps the stream count.

When to use it#

Use it to fit a source to a layout, flip a camera, or shrink a stream before a Composite.

Ports#

PortDirectionSignalLanes
videoInputVideoInferred from the cable
videoOutputVideoInferred from the cable

Parameters#

ParameterLabelRangeDefaultUnitScaleNotes
xX-1 to 10linearHorizontal offset as a fraction of the output width.
yY-1 to 10linearVertical offset as a fraction of the output height.
scaleScale0.05 to 81×logUniform scale about the centre.
rotationRotation-180 to 1800°linearRotation about the centre.
cropCrop0 to 0.490linearFraction trimmed from every edge before scaling.
mirror_hMirror0 to 10linearFlip horizontally. Choices: 0 Off, 1 On.
mirror_vFlip0 to 10linearFlip vertically. Choices: 0 Off, 1 On.
widthWidth0 to 38400pxlinearOutput width in pixels; 0 keeps the source width.
heightHeight0 to 21600pxlinearOutput height in pixels; 0 keeps the source height.

X (x)#

Horizontal offset from -1 to 1.

Y (y)#

Vertical offset from -1 to 1.

Scale (scale)#

Zoom from 0.05 to 8 times; 1 is unchanged. Logarithmic.

Rotation (rotation)#

Rotation in degrees.

Crop (crop)#

Trims each edge, from 0 to 0.49 of the picture.

Mirror (mirror_h)#

Flips the picture left to right when on.

Flip (mirror_v)#

Flips the picture top to bottom when on.

Width (width)#

Output width in pixels; 0 keeps the input width.

Height (height)#

Output height in pixels; 0 keeps the input height.

Tips#

  • Set Width and Height once to fix a Toy's output size.
  • 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, Pixelate, Camera, 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. Move, scale and rotate

beginner Teaches: x, y, scale, rotation, crop, mirror_h, mirror_v

Camera through the transform node.

Patch: Camera video output connected to Transform video input.
Connections as text
  • Camera video output connected to Transform video input
  • Width and height set the output size; 0 keeps the input size.
  • Scale is logarithmic.
Frame preview: Move, scale and rotateFrame “Move, scale and rotate” with 9 elements: knob Crop, text heading, toggle Mirror, toggle Flip, knob Rotation, knob Scale, screen Picture, knob X, knob Y.0CropMOVE, SCALE AND ROTATEMirrorFlip0 °Rotation1 ×Scalescreen0X0Y
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.
  • Pixelate Mosaic cells and posterised levels for a chunky look.
  • Camera A camera feed as one video stream. The Toy names a logical camera; the host binds it to a device after the person allows it.

Edit this page on GitHub

esc

↑ ↓ move↩ open⌘↩ new tabesc close