Skip to main content

CropParams

cropParams selects a rectangular region from the source asset before the element is composed.

Location: an IMAGE, VIDEO, or GIF visual's cropParams field. Coordinates are source pixels, measured from the source's top-left corner; they are not output-canvas coordinates. Cropping and the element's placement/size are separate operations. Keep the rectangle inside the source dimensions.

interface CropParams {
x: number;
y: number;
width: number;
height: number;
}
PropertyRequiredNotes
xYesLeft edge of the crop region.
yYesTop edge of the crop region.
widthYesCrop region width.
heightYesCrop region height.

x and y are nonnegative; width and height are at least 1 pixel, subject to your plan's input-resolution limits. Check actual source dimensions before choosing the crop. See Media assets.

Example​

This is a property fragment to merge into a visual element:

{
"cropParams": {
"x": 100,
"y": 50,
"width": 800,
"height": 600
}
}

Used By​