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;
}
| Property | Required | Notes |
|---|---|---|
x | Yes | Left edge of the crop region. |
y | Yes | Top edge of the crop region. |
width | Yes | Crop region width. |
height | Yes | Crop 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
}
}