Skip to main content

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 region
Link 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}

ComponentDescription
xOffset from the left edge
yOffset from the top edge
wWidth of the crop selection
hHeight of the crop selection

Values are in pixels by default - to use a percentage, include the % sign explicitly, for example, 50%.

https://cdn.media.amplience.net/i/ampproduct/man-with-bag-city-skyline?crop=2000,1000,2000,2500
Try it...

ecrop - Edge crop
Link 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%.

https://cdn.media.amplience.net/i/ampproduct/man-with-bag-city-skyline?ecrop=1000,250,1000,250
Try it...

pcrop - Pre-crop
Link 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%.

https://cdn.media.amplience.net/i/ampproduct/man-with-bag-city-skyline?pcrop=2000,1000,2000,2500&w=200
Try it...
200

pecrop - Pre-edge crop
Link 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%.

https://cdn.media.amplience.net/i/ampproduct/man-with-bag-city-skyline?pecrop=25%,5%,25%,5%
Try it...

rotate - Rotate
Link 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.

https://cdn.media.amplience.net/i/ampproduct/two-friends-on-deck?rotate=45,rgb(228,239,101)
Try it...
45

protate - Pre-rotate
Link copied!

Same as rotate, including the optional ,rgb(...) colour suffix, but applied before any resize.

https://cdn.media.amplience.net/i/ampproduct/two-friends-on-deck?protate=270&w=500
Try it...
270
500

flip - Flip
Link copied!

Flips the image horizontally, vertically, or both.

ParameterDescription
fliph=trueFlip horizontally
flipv=trueFlip vertically
https://cdn.media.amplience.net/i/ampproduct/two-friends-on-deck?fliph=true
Try it...