Crop

Cuts a rectangle out of a texture, by trimming the edges, forcing an aspect ratio, or fitting to a given resolution.

Outputs

NameTypeDescription
OutputTextureThe part of the picture that is cut out.

Inputs

NameTypeDescription
InputTextureThe texture to crop.

Parameters

NameTypeDescription
ModeEnumHow the cut is described. Each mode has settings of its own.Choices: Edges, Aspect Ratio, Resolution, Rectangle
UnitsEnumWhether the values are in pixels or a fraction of the picture between 0 and 1. Only present in Edges and Rectangle mode.Choices: Pixels, Fraction
Left[Units]How much to trim from the left edge. Only present in Edges mode.
Top[Units]How much to trim from the top edge. Only present in Edges mode.
Right[Units]How much to trim from the right edge. Only present in Edges mode.
Bottom[Units]How much to trim from the bottom edge. Only present in Edges mode.
Aspect RatioEnumThe shape of the frame. Only present in Aspect Ratio mode.Choices: Original, Square, 16:9, 9:16, 16:10, 21:9, 4:3, 3:2, 4:5, Custom
Custom RatioVector 2The width and the height the frame's shape is taken from, such as 2.39 and 1. Only present in Aspect Ratio mode when Aspect Ratio is Custom.
ResolutionVector 2 IntThe width and height of the output in pixels. Only present in Resolution mode.
ZoomFloatHow far to zoom in. 1 shows everything the frame can hold. Only present in Aspect Ratio and Resolution mode.
OffsetVector 2How far the picture is moved under the frame, in pixels, with up as positive. Only present in Aspect Ratio and Resolution mode.
AngleFloatHow far the picture is turned under the frame, in degrees, counterclockwise. Only present in Aspect Ratio and Resolution mode.
Stay InsideBoolWhether the frame is kept on the picture, also when it is turned. When off, whatever lies beyond the picture is transparent. Only present in Aspect Ratio and Resolution mode.
Position[Units]The top left corner of the rectangle, measured from the top left corner of the picture. Only present in Rectangle mode.
Size[Units]The width and height of the rectangle. Only present in Rectangle mode.
FilteradvancedEnumHow the picture is read between its pixels when it is zoomed or turned. Nearest keeps hard pixels, and Linear Nice keeps edges next to transparency clean.Choices: Nearest, Linear Fast, Linear Nice
FormatadvancedEnumThe pixel format of the output. Auto keeps the format of the input.

The Crop operator cuts a rectangle out of a texture. Use it to trim a picture, to frame it in another shape, or to pan and zoom across it.

In Edges mode, an amount is trimmed off each side. In Rectangle mode, the position and size of the part to keep are given. In both, a value past the edge of the picture adds a transparent margin.

In Aspect Ratio mode, a frame of the chosen shape sits over the middle of the picture, and Offset, Zoom and Angle move the picture under it. Resolution mode does the same with a frame of an exact size in pixels. The output size stays the same while the picture moves, which makes these two modes good for animated pans and zooms.

See also Flip.

Keywords: cut, trim, frame, aspect ratio, resolution, square, straighten, zoom, pan, ken burns, margin, border