AEM Assets · updated

Dynamic Media Image Serving URLs: wid, hei, fmt, qlt, fit and the other common parameters

An Image Serving URL is the server, the fixed path /is/image, the object (company and asset name) and then modifiers after a question mark, joined with &. wid and hei set the size in pixels, fmt the format, qlt the JPEG quality from 1 to 100, and fit how the image fills the size. A preset name between dollar signs, such as $Large$, stands for a saved set of these.

In plain words

You do not make ten sizes of a picture. You upload one and write the size you want into the web address. The server makes that version on the first request and the CDN keeps it. The short codes in the address are instructions: wid=400 means 'make it 400 pixels wide'.

The shape of the URL

Adobe gives the syntax as http://server/is/image[/object][?modifiers]. The /is/image part is required for every request. Command names and macro names are not case-sensitive; the server keeps the case of other values.

Common commands

CommandValueWhat Adobe says
widWhole number above 0Width of the response image. With hei and no scl, the image is scaled to fit inside the wid/hei rectangle
heiWhole number above 0Height of the response image. On its own, the width follows the image's shape
fmtFor example jpeg, pjpeg, png, png-alpha, gif, webp, webp-alpha, avif, avif-alphaThe format and the response MIME type. The '-alpha' forms keep transparency
qlt1 to 100, optionally followed by ,0 or ,1JPEG quality. The second value switches chroma down-sampling off when 1. Values above 90 are often indistinguishable from the uncompressed image
fitmode,upscaleModes: fit, constrain, crop, wrap, stretch, hfit, vfit. Upscale is 0 or 1. The default is fit,0. Needs wid or hei, or an error is returned
dproff, or on,valueDevice pixel ratio. on,2 delivers an image twice the requested size. The default is off
bfcon or offBrowser format conversion: with on, Smart Imaging converts JPEG and PNG to a newer lossy format the browser supports
$name$A macro or image preset nameReplaced by the commands it stands for. Commands written after it override it

The fit modes

  • fit: the whole image, exact wid and hei, with background where the shape differs.
  • constrain: like fit, but the response may be smaller than asked, so there is no background.
  • crop: fills the whole area, cutting off as little as possible.
  • wrap: like crop, but the response may be larger than asked, so nothing is cut off.
  • stretch: fills the area by changing the image's shape.
  • hfit and vfit: fit tightly across or down; Adobe calls them useful for special applications.

Encoding

Adobe says command values must be encoded with %xx sequences so that they do not contain =, & or %, and that unsafe characters such as spaces, quotes, angle brackets and # must be encoded too. If the calculated image is larger than the account's MaxPix setting, an error is returned.

bfc and dpr are part of Smart Imaging, which Adobe says requires the CDN bundled with Dynamic Media.

Adobe's own examples (from the wid, qlt and dpr pages)

http://server/myRootId/myImageId?wid=200&hei=200&align=1,-1
http://server/myRootId/myImageId?qlt=95,1&wid=300
https://smartimaging.scene7.com/is/image/ADBE/AdobeStock_409826521?dpr=on,3

How to build one

  1. In AEM Assets, copy the URL of a published asset to see your server and company name.
  2. Keep the part up to and including the asset name. Remove any modifiers after the question mark.
  3. Add wid, or wid and hei, for the size the page needs.
  4. Add fit=crop,0 with both wid and hei if the image must fill a fixed box.
  5. Leave fmt and qlt out to use the server defaults, or set them if you need a fixed format or quality.
  6. Use the delivery URL builder on this site to write the URL and an <img> tag with one URL per width.

Related tools and pages on this site

Questions

What happens if I give only wid?

Adobe's wid page says the image is delivered at that width with a height that keeps its shape, with no background areas.

Which comes first, the preset or wid?

Put the preset first. Adobe's macro page says commands inside a macro override the same commands written before it, so wid written before $name$ has no effect.

Is qlt used for PNG?

No. Adobe says qlt is ignored if the output format does not support JPEG encoding. WebP and some other formats also use qlt, but the same number gives a different quality in each format.

What is the difference between fit=fit and fit=constrain?

Both show the whole image. fit returns exactly the size you asked for, adding background if needed. constrain may return a smaller image to avoid the background.

Sources

Facts about Adobe's products on this page are from the linked Adobe pages, read on the date shown beside each. Explanations, steps and examples are ours unless marked as Adobe's. If Adobe's page and this one differ, Adobe's page is right.

Surge Migrate is not affiliated with Adobe and claims no Adobe partner status. Adobe product names are trademarks of Adobe.

Surge Migrate

Moving the website itself

This page answers one AEM Assets question. Surge Migrate moves a website from any CMS to any CMS. Converted automatically. Checked before you install.

  1. 1

    Scan

    Names the system behind your site, counts pages and templates, lists the blocks to build and the work no tool does, and gives an effort range with its working.

    Scan a site →
  2. 2

    Convert

    Each page becomes an Edge Delivery document, an AEM Core Component page and import files for 7 other systems. 10 pages free; 500 or 2,000 pages in one paid run.

    Convert your pages →
  3. 3

    Verify

    A download is offered only when its own format check passes. The report lists every field not found and every component kept as plain content. Compare old and new pages side by side.

    Parity check →
  4. 4

    Install

    You import with the target system's own tool, on your own environment. Each download's README gives the command. Your system changes only when you run it.

    How each import was tested →