---
canonical: https://amplience.com/developers/docs/apis/media-delivery/media-delivery-reference/sizing-and-scaling/
title: Sizing and scaling
  interactive: true
description: Resize and scale images with Amplience Dynamic Media using the Media Delivery API parameters w, h, maxW, maxH, scale modes, point of interest, resize filters, and upscale behaviour.
keywords:
  - Dynamic Media
  - Media Delivery API
  - Dynamic Media resize image
  - image width and height parameters
  - scale mode
  - point of interest
  - upscale
audience: Developer
date_published: 2026-07-12
date_modified: 2026-07-27
---

# Sizing and scaling

The Media Delivery API lets you resize an image by setting a width, a height, or an upper bound on either, then control how it fills the space you have asked for. Scale mode decides what happens when the source and target aspect ratios differ, and point of interest decides which part of the image survives a crop.

> **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/).

## Sizing {#sizing}

The parameters here work in two pairs. `w` and `h` set an exact output size, while `maxW` and `maxH` set a ceiling that only applies when a request exceeds it. Both pairs preserve the aspect ratio - changing the shape of an image is the job of scale mode.

> **Tip:** These parameters resize at delivery time without altering the master asset. To resize the asset itself as part of an automated workflow, use the [Adjust image size](https://amplience.com/developers/docs/workforce/flows/action-reference/image-actions/#adjust-image-size) action in Workforce flows.

### `w` - Width {#w}

Sets the output width in pixels. If only `w` is specified, height is calculated automatically to preserve the aspect ratio. See the [height](#h) example below.

```uri
https://cdn.media.amplience.net/i/ampproduct/woman-checked-skirt-striped-bag?w=400
```

### `h` - Height {#h}

Sets the output height in pixels. If only `h` is specified, width is calculated automatically to preserve the aspect ratio. Set a width below to override the automatic calculation; clear it to return to aspect-ratio scaling.

```uri
https://cdn.media.amplience.net/i/ampproduct/woman-checked-skirt-striped-bag?h=400
```

> **Tip:** Add a width above and see how the URL updates - a width parameter is appended, chained with a `&`.

### `maxW` - Maximum width {#maxw}

Sets the maximum width for the returned image. Requests above it are clamped, with the height then following the aspect ratio from the clamped width. Can also be configured at the account level.

#### Example

Requests 2000px from the 6000×4000 source; the output is clamped to 1200px wide, with the height following the aspect ratio:

```uri
https://cdn.media.amplience.net/i/ampproduct/man-with-bag-city-skyline?w=2000&maxW=1200
```

### `maxH` - Maximum height {#maxh}

Sets the maximum height for the returned image. Requests above it are clamped, with the width then following the aspect ratio from the clamped height. Can also be configured at the account level.

#### Example

Requests 2000px tall; the output is clamped to 1200px, and the width follows the aspect ratio (1800px for this source):

```uri
https://cdn.media.amplience.net/i/ampproduct/man-with-bag-city-skyline?h=2000&maxH=1200
```

## Scale mode {#scale-mode}

If you ask for a width and height that don't match the shape of the original image - for example, a square from a landscape photo - the image can't fill that space exactly. These parameters let you choose what happens - whether it's cropped or stretched to fit, which part of it is kept, and how it's redrawn at the new size.

> **Tip:** These parameters crop at delivery time without altering the master asset. To crop or trim the asset itself as part of an automated workflow, use the [Crop](https://amplience.com/developers/docs/workforce/flows/action-reference/image-actions/#crop-image) or [Trim](https://amplience.com/developers/docs/workforce/flows/action-reference/image-actions/#trim-image) actions in Workforce flows.

### `sm` - Scale mode {#sm}

Controls how the image is positioned or cropped when it does not fit exactly to the requested width and height.

| Value | Description |
|---|---|
| `c` | Crop to fit |
| `s` | Stretch |
| `tl` | Top left |
| `tc` | Top center |
| `tr` | Top right |
| `ml` | Middle left |
| `mc` | Middle center |
| `mr` | Middle right |
| `bl` | Bottom left |
| `bc` | Bottom center |
| `br` | Bottom right |
| `aspect` | Maintain aspect ratio - ratio needs to be specified for example `sm=aspect&aspect=16:9`|
| `edge` | Resize to a specified edge - see [`sm=edge`](#sm-edge) |
| `clamp` | Fit within area without padding - see [`sm=clamp`](#sm-clamp) |

This example requests a portrait window from a landscape scene, so every mode must crop or stretch - switch between the corner values to watch the crop move across the scene:

```uri
https://cdn.media.amplience.net/i/ampproduct/man-with-bag-city-skyline?w=300&h=400&sm=c
```

#### Example - maintain aspect ratio

```uri
https://cdn.media.amplience.net/i/ampproduct/blur-brass-bronze-timepiece?w=256&sm=aspect&aspect=16:9
```

### `sm=edge` - Resize to edge {#sm-edge}

Resizes the image so that a specific edge matches a target length. Requires `resize.edge` and `resize.edge.length`.

| Parameter | Values | Description |
|---|---|---|
| `resize.edge` | `w`, `h`, `largest`, `smallest` | Which edge to target |
| `resize.edge.length` | Integer (pixels) | Target length in pixels |

```uri
https://cdn.media.amplience.net/i/ampproduct/blur-brass-bronze-timepiece?sm=edge&resize.edge=w&resize.edge.length=250
```

### `sm=clamp` - Clamp to bounds {#sm-clamp}

Fits the image into the specified width and height while maintaining the aspect ratio and avoiding any padding.

```uri
https://cdn.media.amplience.net/i/ampproduct/blur-brass-bronze-timepiece?w=400&h=1000&sm=clamp
```

### `scaleFit` - Scale fit mode {#scalefit}

Specifies how to position the crop area when using `sm`.

| Value | Description |
|---|---|
| `center` | Default |
| `poi` | Crop using the point of interest focal point |

See `scaleFit=poi` in action in the [`poi` example](#poi) below.

### `poi` - Point of interest {#poi}

Defines a focal point for cropping. Takes four comma-separated values representing the focal region as percentages of the image dimensions.

| Component | Description |
|---|---|
| `x` | Left edge of the focal point as a percentage of image width |
| `y` | Top edge of the focal point as a percentage of image height |
| `w` | Width of the focal point as a percentage of image width |
| `h` | Height of the focal point as a percentage of image height |

```uri
https://cdn.media.amplience.net/i/ampproduct/Hero-Banner-720-model2?w=320&h=480&sm=c&poi=0.74,0.0,0.32,0.14&scaleFit=poi
```

> **Tip:** The source image is 1028 x 685 pixels - try playing with `scaleFit` at these settings too.

### `filter` - Resize algorithm {#filter}

The resampling algorithm used when resizing the image.

| Value | Description |
|---|---|
| `q` | Quadratic |
| `s` | Sinc |
| `l` | Lanczos (default) |
| `p` | Point |
| `c` | Cubic |
| `h` | Hermite |

Resampling differences are most visible when fine patterns are downscaled hard - compare the algorithms on the checked and striped fabric:

```uri
https://cdn.media.amplience.net/i/ampproduct/woman-checked-skirt-striped-bag?w=250&filter=l
```

### `upscale` - Upscale behaviour {#upscale}

Controls whether the image can be scaled larger than the original.

| Value | Description |
|---|---|
| `true` | Allow upscaling |
| `false` | Do not upscale |
| `padd` | Draw the image, unscaled, on a canvas of the requested size. Specify **both** `w` and `h` to define the canvas - with one dimension the canvas matches the image and no padding appears. Alignment is set via `sm`; background colour via `bg` |

```uri
https://cdn.media.amplience.net/i/ampproduct/woman-coat-blue-scarf?w=1500&upscale=true
```

#### Example - `padd` with a defined canvas

Both dimensions define the canvas; the 1280×853 original is drawn unscaled and centred, with the background colour filling the remainder:

```uri
https://cdn.media.amplience.net/i/ampproduct/woman-coat-blue-scarf?w=1500&h=1500&upscale=padd&bg=rgb(228,239,101)&sm=mc
```
