---
canonical: https://amplience.com/developers/docs/apis/media-delivery/media-delivery-reference/cropping-and-rotation/
title: Cropping and rotation
  interactive: true
description: Crop, edge crop, pre-crop, rotate, pre-rotate, and flip images with Amplience Dynamic Media using the Media Delivery API.
keywords:
  - Dynamic Media
  - Media Delivery API
  - Dynamic Media crop image
  - edge crop
  - pre-crop
  - rotate image
  - flip image
audience: Developer
date_published: 2026-07-12
date_modified: 2026-07-27
---

# Cropping and rotation {#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.

> **Note: 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](https://amplience.com/developers/docs/apis/media-delivery/media-delivery-reference/).

## `crop` - Crop region {#crop}

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%.

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

## `ecrop` - Edge crop {#ecrop}

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%.

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

## `pcrop` - Pre-crop {#pcrop}

Same as [`crop`](#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%.

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

## `pecrop` - Pre-edge crop {#pecrop}

Same as [`ecrop`](#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%.

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

## `rotate` - Rotate {#rotate}

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.

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

## `protate` - Pre-rotate {#protate}

Same as [`rotate`](#rotate), including the optional `,rgb(...)` colour suffix, but applied **before** any resize.

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

## `flip` - Flip {#flip}

Flips the image horizontally, vertically, or both.

| Parameter | Description |
|---|---|
| `fliph=true` | Flip horizontally |
| `flipv=true` | Flip vertically |

```uri
https://cdn.media.amplience.net/i/ampproduct/two-friends-on-deck?fliph=true
```
