Skip to main content
Set w and h to define the output box. fit controls how the source fills that box; gravity, crop, or fp controls where the crop lands when using fit=cover.
Center vs smart gravity side by side

Off-centre hero — gravity=center (left) vs gravity=smart (right).

Center crop vs focal point crop

Manual focal point — gravity=center (left) vs fp=x,y (right).

Hero cropped with rect and aspect ratio

Source crop + 16:9 — ?rect=8%,12%,84%,76&w=1200&ar=16:9.

Product photo at 21:9 aspect ratio

Wide banner — ?w=1200&ar=21:9&fit=cover.

Source crop and aspect ratio

Use rect to crop the source before resize/gravity:
When only one output dimension is set, ar derives the other (w=1200&ar=16:9 → 675px tall).

Fit strategies

fit=cover example

fit=cover

fit=contain example

fit=contain

fit=fill example

fit=fill

fit=inside example

fit=inside

fit=outside example

fit=outside

Smart cropping

Uncropped hero source image

Full-width source before any crop.

Face-aware crop on a portrait

gravity=face portrait crop.

Entropy crop on a texture

gravity=entropy texture crop.

For focal-point workflows, palette extraction, and /api/images/analyze, see Smart cropping & image analysis.

Focal zoom (fp-z)

fp-z (alias fpZ) zooms toward the focal point by shrinking the crop window before resize. Range 1–10; higher values tighten the crop.
Pair with fp=x,y from manual focal points or /api/images/analyze for art-directed thumbnails that stay centred on the subject at smaller sizes.

Device pixel ratio

dpr multiplies output pixels while preserving layout size in CSS. Render a 400px slot with w=400&dpr=2 to receive an 800px asset for Retina displays. Valid range: 1–4.
When to use dpr vs srcset width descriptors You do not need both dpr=2 and 1200w in the same srcset entry — pick one model per image.
Last modified on July 17, 2026