Cropping and rotation
Use the Media Delivery API to select a region of an image or trim in from its edges, then rotate or flip the result. Each of these has a pre-scale equivalent, prefixed with p, that acts on the original asset rather than on the resized output.
Base URL pattern
The parameters on this page are appended to a Dynamic Media image URL. For the URL pattern and how parameters chain together, see the Media Delivery API guide.
crop - Crop regionLink copied!
Cuts out a region of the image. Applied after any resize, so coordinates are relative to the resized image.
Format: crop={x},{y},{w},{h}
| Component | Description |
|---|---|
x | Offset from the left edge |
y | Offset from the top edge |
w | Width of the crop selection |
h | Height of the crop selection |
Values are in pixels by default - to use a percentage, include the % sign explicitly, for example, 50%.
ecrop - Edge cropLink copied!
Crops a specified amount from each edge. Applied after any resize.
Format: ecrop={left},{top},{right},{bottom}
Values are in pixels by default - to use a percentage, include the % sign explicitly, for example, 50%.
pcrop - Pre-cropLink copied!
Same as crop, but applied before any resize. Coordinates are relative to the original image size. Values are in pixels by default - to use a percentage, include the % sign explicitly, for example, 50%.
pecrop - Pre-edge cropLink copied!
Same as ecrop, but applied before any resize. Coordinates are relative to the original image size. Values are in pixels by default - to use a percentage, include the % sign explicitly, for example, 50%.
rotate - RotateLink copied!
Rotates the image by the specified number of degrees. Applied after any resize.
Format: rotate={degrees} or rotate={degrees},rgb({r},{g},{b})
For angles that aren't a multiple of 90°, the tilted image exposes canvas at the corners of the output. Colour those pixels with the optional rgb value, appended to the angle with a comma - it is part of the rotate value, not a separate parameter.
protate - Pre-rotateLink copied!
Same as rotate, including the optional ,rgb(...) colour suffix, but applied before any resize.
flip - FlipLink copied!
Flips the image horizontally, vertically, or both.
| Parameter | Description |
|---|---|
fliph=true | Flip horizontally |
flipv=true | Flip vertically |