Skip to main content

Crop

Cropping dimensions (x, y, width, height) for an image transformation.

Notes

Defines the region of the image to keep: x and y give its top-left corner, width and height its size. Everything outside that rectangle is discarded.

Cropping is applied last, after scaling and rotation, so the coordinates refer to the image as those steps left it.

Usage

height: 0
width: 0
x: 0
y: 0

Properties

PropertyTypeRequiredDefault
heightintegerNo-
widthintegerNo-
xintegerNo0
yintegerNo0

Property Details

height

Height of the region to keep, in pixels. If only one of height and width is set, the same value is used for both, giving a square.

width

Width of the region to keep, in pixels. If only one of height and width is set, the same value is used for both, giving a square.

x

Distance in pixels from the left edge of the image to the left edge of the region to keep. Defaults to 0.

y

Distance in pixels from the top of the image to the top of the region to keep. Defaults to 0.