GET/1 credit per call · 1-year immutable cache
// PRODUCT · TRANSFORM

Transform.

Resize, crop, recompress, mark, and background-remove — all in one URL. The endpoint most apps live on.

quick start
# 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'
Live preview of Transform
Live preview · streamed from demo.imgapis.com
// LIVE SAMPLES

Six recipes, one endpoint.

Each card hits demo.imgapis.com live. Same /transform URL — different query params.

Resize to 400 wide, auto format
Resize to 400 wide, auto format
path=unsplash/photo-1506905925346-21bda4d32df4
w=400format=auto
Force 4:3 aspect ratio
Force 4:3 aspect ratio
path=unsplash/photo-1506905925346-21bda4d32df4
w=800ar=4:3
Convert to AVIF at quality 70
Convert to AVIF at quality 70
path=unsplash/photo-1506905925346-21bda4d32df4
w=800format=avifquality=70
Square thumbnail with face-aware crop
Square thumbnail with face-aware crop
path=unsplash/photo-1494790108377-be9c29b29330
size=320fit=covergravity=face
Mark at bottom-right
Mark at bottom-right
mark=dash.imgapis.com/images/icon.png
w=800mark-w=120mark-align=bottom,rightmark-pad=16
Background removal (5 cr)
Background removal (5 cr)
path=unsplash/photo-1494790108377-be9c29b29330
w=600bg-remove=true
// PARAMETERS

One endpoint. Every param.

Every knob behind /transform. Required ones carry a pink rail. The rest default sensibly.

// parameters22fields
srcRequired
stringType
Default

Source 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
integer (1–2048)Type
Default

Output width in pixels.

hOptional
integer (1–2048)Type
Default

Output height in pixels.

sizeOptional
integer (1–2048)Type
Default

Shortcut that sets both w and h to the same value. Explicit w/h override.

arOptional
stringType
Default

Output aspect ratio in W:H form (e.g. 4:3) or a positive decimal. Forces fit=cover so the source fills the box.

dprOptional
number (0–2)Type
1Default

Device-pixel-ratio multiplier. Final dimensions clamped to ≤4096 per axis.

fitOptional
enumType
Default

Image fit mode.

containcovercroppadscale-downsqueeze
gravityOptional
enumType
Default

Focal point preserved when fit=cover/crop trims the image. face runs face detection (falls back to auto when none found).

autocenterface
formatOptional
enumType
Default

Output format. When omitted, Accept decides (avif > webp > source). nocompress mirrors the source content-type, except WebP / AVIF sources which are re-encoded to PNG.

avifjpegjpgnocompresspngwebp
qualityOptional
integer (1–100)Type
95Default

Encoder quality. Applies to lossy formats.

blurOptional
number (≥0)Type
0Default

Gaussian blur radius.

bgOptional
stringType
Default

Background color for pad fit or transparent sources.

bg-removeOptional
booleanType
falseDefault

Set true to extract the foreground (remove the background). Costs 5 credits per call instead of 1 — AI-backed.

markOptional
stringType
Default

Mark image URL. Triggers overlay when present.

mark-wOptional
string-or-percentType
15%Default

Mark width. Pixels (e.g. 100) or percentage of source width (e.g. 50%).

mark-hOptional
string-or-percentType
Default

Mark height. Pixels or percentage of source height. Aspect ratio is preserved from mark-w when omitted.

mark-sizeOptional
string-or-percentType
Default

Shortcut that sets both mark-w and mark-h. Explicit mark-w/mark-h override.

mark-fitOptional
enumType
containDefault

How the mark fits into mark-w × mark-h.

containcovercroppadscale-downsqueeze
mark-alignOptional
csvType
top,leftDefault

Comma-separated anchor: one horizontal token (left/right) plus one vertical token (top/bottom).

bottomleftrighttop
mark-padOptional
string-or-percentType
2%Default

Offset from the aligned edge(s). Pixels or percentage of the smaller source dimension.

mark-opacityOptional
number (0–1)Type
1Default

Mark opacity (0 = transparent, 1 = opaque).

mark-repeatOptional
enumType
Default

Tile the mark across the canvas. true = both axes, x = horizontal only, y = vertical only.

truexy
// COOL USAGES

Ship a CDN-ready image in one URL.

// 01

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.

// 02

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.

// 03

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.

// 04

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.