Skip to main content

Format and quality

The Media Delivery API lets you set the output format explicitly, or let fmt=auto serve the best format each browser supports. Compression can be set for a single request, per format, or left to the defaults configured for your account.

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.

Verifying format and quality changes

Most parameters in this section change the encoded file rather than its on-screen appearance, so an interactive preview would look identical before and after. To verify them, open the generated URL in a new tab and check the response Content-Type header and transfer size in your browser's developer tools (Network tab). For more detail on how to find this information, see the Amplience Smart Images example.

qlt — Quality
Link copied!

Sets the compression quality as a percentage (0–100). JPEG is lossy; PNG is lossless but zlib-compressed.

This example pins fmt=jpg and a 500px output so compression artefacts are visible at preview size. Switch the format to png and the image stops changing - on PNG output, qlt affects file size but not appearance.

https://cdn.media.amplience.net/i/ampproduct/woman-checked-skirt-striped-bag?w=500&fmt=jpg&qlt=80
Try it...
80

fmt — Output format
Link copied!

Sets the output format. If not specified, the format matches the original. Setting the image file extension also changes the format.

Supported values: jpg, png, gif, bmp, webp, avif, jp2

Note
  • webp is not supported in all browsers. See browser support.
  • jp2 is supported in Safari for iOS and macOS only.
  • avif requires Accelerated Media. Images larger than 2.5 megapixels fall back to jpeg (or png if transparency is present).

Example:

https://cdn.media.amplience.net/i/ampproduct/woman-checked-skirt-striped-bag?fmt=png

fmt=auto — Auto format
Link copied!

Returns the image in the most efficient format supported by the requesting browser.

Info

This feature, and avif support, requires Accelerated Media.

Format selection priority:

  1. avif - if enabled on your account and supported by the browser
  2. webp - for Safari, Chrome, Firefox and other browsers that support it
  3. jp2 - for Safari versions that support jp2 but not webp
  4. jpg - fallback for all other browsers
  5. png - if the original image contains transparency and the browser is Safari

Example:

https://cdn.media.amplience.net/i/ampproduct/women-bright-colors.jpg?fmt=auto

For more information, see Amplience Smart Images.

qlt=default — Default format quality
Link copied!

Applies the platform default quality setting for the output format. Can be combined with fmt=auto.

Default quality values by format:

FormatDefault quality
jp240
avif55
webp80
jpeg75
png90

Custom defaults can be set in your account root template or transformation templates.

Example:

https://cdn.media.amplience.net/i/ampproduct/women-bright-colors.jpg?fmt=auto&qlt=default

Per-format quality parameters
Link copied!

Sets the compression quality for a specific output format. Can be combined with fmt=auto.

ParameterFormat
fmt.avif.qltAVIF
fmt.webp.qltWebP
fmt.jp2.qltJPEG 2000
fmt.jpeg.qltJPEG
fmt.png.qltPNG

Example:

https://cdn.media.amplience.net/i/ampproduct/women-bright-colors.jpg?fmt=auto&fmt.webp.qlt=50

dpi - Dots per inch
Link copied!

Changes the image resolution. If not specified, the image is returned at its original DPI.

Example:

https://cdn.media.amplience.net/i/ampproduct/signature-hat-german?dpi=120&w=200

dpiFilter - DPI resampling algorithm
Link copied!

Specifies the resampling algorithm used when the DPI is changed.

ValueDescription
qQuadratic
sSinc
lLanczos (default)
pPoint
cCubic

Example:

https://cdn.media.amplience.net/i/ampproduct/signature-hat-german?dpi=120&dpiFilter=q&w=200

strip - Strip metadata
Link copied!

Removes commands and metadata from the image. Accepts true or false. Default is false.

Example:

https://cdn.media.amplience.net/i/ampproduct/woman-checked-skirt-striped-bag?strip=true

fmt.jpeg.chroma - Chroma subsampling
Link copied!

Controls JPEG chroma subsampling, which reduces file size by sampling colour at a lower rate than brightness.

ValueDescription
2,1,1Enabled (default)
1,1,1Disabled

Disabling chroma subsampling increases file size; consider reducing qlt to compensate.

Example:

https://cdn.media.amplience.net/i/ampproduct/woman-checked-skirt-striped-bag?fmt=jpg&fmt.jpeg.chroma=1,1,1

fmt.jpeg.interlaced - Progressive JPEG
Link copied!

Add fmt.jpeg.interlaced=true to a JPEG URL to return the image as a progressive JPEG. Progressive JPEGs load a low-quality version of the whole image first and refine it as more data downloads, rather than rendering top-to-bottom.

The effect is only observable while the file is downloading - on a fast connection the image simply appears complete, so there is nothing useful to preview here. To see it in action, apply the parameter to a large JPEG and load it with network throttling enabled in your browser's developer tools.

See the progressive images guide for more information.

PNG output options
Link copied!

Control how PNG output is encoded. All three parameters affect file size rather than on-screen appearance.

ParameterValuesDescription
fmt.png.indexedtrue / falseUse an indexed colour palette rather than per-pixel colour data. Default: false.
fmt.png.palettesize1–256Colour palette size for indexed PNGs. Requires fmt.png.indexed=true. Default: 256.
fmt.png.dithertrue / falseDithering for indexed PNGs. Smooths colour banding but may slightly increase file size. Default: true.

Example:

https://cdn.media.amplience.net/i/ampproduct/woman-checked-skirt-striped-bag?fmt=png&fmt.png.indexed=true&fmt.png.palettesize=256&fmt.png.dither=true