/1 credit per call · 1-year immutable cacheTransform.
Resize, crop, recompress, mark, and background-remove — all in one URL. The endpoint most apps live on.
# Hero card · 1200×675 AVIF · face-aware crop
curl 'https://demo.imgapis.com/unsplash/photo-1506905925346-21bda4d32df4?\
w=1200&ar=4:3&format=avif&quality=82&gravity=face'Six recipes, one endpoint.
Each card hits demo.imgapis.com live. Same /transform URL — different query params.

One endpoint. Every param.
Every knob behind /transform. Required ones carry a pink rail. The rest default sensibly.
srcRequired—DefaultSource image. Full URL, source-alias form (<source-name>/<path>), or omit src and use the path-sugar form /<source-name>/<path>. Exactly one src — use /grid for multi-image composition.
wOptional—DefaultOutput width in pixels.
hOptional—DefaultOutput height in pixels.
sizeOptional—DefaultShortcut that sets both w and h to the same value. Explicit w/h override.
arOptional—DefaultOutput aspect ratio in W:H form (e.g. 4:3) or a positive decimal. Forces fit=cover so the source fills the box.
dprOptional1DefaultDevice-pixel-ratio multiplier. Final dimensions clamped to ≤4096 per axis.
fitOptional—DefaultImage fit mode.
containcovercroppadscale-downsqueezegravityOptional—DefaultFocal point preserved when fit=cover/crop trims the image. face runs face detection (falls back to auto when none found).
autocenterfaceformatOptional—DefaultOutput format. When omitted, Accept decides (avif > webp > source). nocompress mirrors the source content-type, except WebP / AVIF sources which are re-encoded to PNG.
avifjpegjpgnocompresspngwebpqualityOptional95DefaultEncoder quality. Applies to lossy formats.
blurOptional0DefaultGaussian blur radius.
bgOptional—DefaultBackground color for pad fit or transparent sources.
bg-removeOptionalfalseDefaultSet true to extract the foreground (remove the background). Costs 5 credits per call instead of 1 — AI-backed.
markOptional—DefaultMark image URL. Triggers overlay when present.
mark-wOptional15%DefaultMark width. Pixels (e.g. 100) or percentage of source width (e.g. 50%).
mark-hOptional—DefaultMark height. Pixels or percentage of source height. Aspect ratio is preserved from mark-w when omitted.
mark-sizeOptional—DefaultShortcut that sets both mark-w and mark-h. Explicit mark-w/mark-h override.
mark-fitOptionalcontainDefaultHow the mark fits into mark-w × mark-h.
containcovercroppadscale-downsqueezemark-alignOptionaltop,leftDefaultComma-separated anchor: one horizontal token (left/right) plus one vertical token (top/bottom).
bottomleftrighttopmark-padOptional2%DefaultOffset from the aligned edge(s). Pixels or percentage of the smaller source dimension.
mark-opacityOptional1DefaultMark opacity (0 = transparent, 1 = opaque).
mark-repeatOptional—DefaultTile the mark across the canvas. true = both axes, x = horizontal only, y = vertical only.
truexyShip a CDN-ready image in one URL.
Responsive hero images
One URL with ?w=, ?ar= and format=avif powers an entire <img srcset> ladder. Same cache key per (width, format) — every breakpoint pays once.
On-the-fly thumbnails
Generate size=320&fit=cover&gravity=face thumbnails from full-bleed originals without a pre-processing job. Face detection finds the subject, gravity preserves it.
Email-safe JPEGs
Newsletters demand JPEG. Force format=jpeg&quality=82 per asset in your email pipeline; AVIF stays in the browser path. Same source, two ladders.
Background-removed product shots
Drop bg-remove=true&bg=ffffff on a product image and serve a white-bg cutout. No Photoshop pass, no asset-processing queue. Costs 5 credits per call — AI-backed.