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.




Source crop and aspect ratio
Userect to crop the source before resize/gravity:
ar derives the other (w=1200&ar=16:9 → 675px tall).
Fit strategies
fit | Behaviour |
|---|---|
cover (default) | Fills the box, cropping overflow. Pairs with gravity for smart cropping. |
contain | Fits inside the box, padding with transparency. |
fill | Stretches to fill the box. |
inside | Scales down without enlarging. |
outside | Scales to cover on the smallest axis. |





Smart cropping
| Mode | When to use |
|---|---|
gravity=auto (default) | Fast saliency — best default for most photos. |
gravity=smart / crop=smart | Content-aware scoring for off-centre subjects. |
gravity=face | Centres crop on detected faces; falls through to smart if none found. |
gravity=entropy | Texture-heavy sources with no obvious subject. |
fp=x,y | Hand-picked focal point — cheapest and deterministic at scale. |



/api/images/analyze, see Smart cropping & image analysis.
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.