GET/grid2 credits per image composed · 1-year immutable cache
// PRODUCT · GRID

Grid.

Stitch 2–5 images into one URL — og:image carousels, before/after pairs, mood boards. No asset pipeline.

quick start
# Open Graph carousel · 1200×630 · 4 photos
curl 'https://demo.imgapis.com/grid?src=unsplash/photo-1506905925346-21bda4d32df4\
&src=unsplash/photo-1507525428034-b723cf961d3e\
&src=unsplash/photo-1469474968028-56623f02e42e\
&src=unsplash/photo-1494790108377-be9c29b29330\
&w=1200&h=630&type=classic&cols=2&gap=4'
Live preview of Grid
Live preview · streamed from demo.imgapis.com
// LIVE SAMPLES

Two to five sources. One image out.

Each composition is one /grid URL with 2–5 ?src= params. Same cache key, same edge cost.

4-image · 800×600
4-image · 800×600
src=unsplash/photo-1506905925346-21bda4d32df4
src=unsplash/photo-1507525428034-b723cf961d3e
src=unsplash/photo-1469474968028-56623f02e42e
src=unsplash/photo-1494790108377-be9c29b29330
w=800h=600
4-image classic grid · 8px gap
4-image classic grid · 8px gap
src=unsplash/photo-1506905925346-21bda4d32df4
src=unsplash/photo-1507525428034-b723cf961d3e
src=unsplash/photo-1469474968028-56623f02e42e
src=unsplash/photo-1494790108377-be9c29b29330
w=800h=800type=classiccols=2gap=8
3-image vertical column
3-image vertical column
src=unsplash/photo-1506905925346-21bda4d32df4
src=unsplash/photo-1507525428034-b723cf961d3e
src=unsplash/photo-1469474968028-56623f02e42e
w=600h=900type=column
5-image horizontal row · no gap
5-image horizontal row · no gap
src=unsplash/photo-1506905925346-21bda4d32df4
src=unsplash/photo-1507525428034-b723cf961d3e
src=unsplash/photo-1469474968028-56623f02e42e
src=unsplash/photo-1494790108377-be9c29b29330
src=unsplash/photo-1506905925346-21bda4d32df4
w=1500h=400type=row
// PARAMETERS

Five params, every layout.

Five params drive every composition. Layouts cover the common cases — fall back to custom for everything else.

// parameters9fields
src2–5 times
stringType
Default

Image URLs to compose. Repeat the param 2–5 times. Invalid sources are dropped silently.

wRequired
integer (1–2048)Type
Default

Output width in pixels.

hRequired
integer (1–2048)Type
Default

Output height in pixels.

sizeOptional
integer (1–2048)Type
Default

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

dprOptional
number (0–2)Type
1Default

Device-pixel-ratio multiplier.

typeOptional
enumType
autoDefault

Layout algorithm.

autoclassiccolumnrow
colsOptional
integer (≥1)Type
2Default

Column count for classic / column layouts.

gapOptional
integer (≥0)Type
0Default

Gap in pixels between cells.

formatOptional
enumType
Default

Output format. When omitted, Accept decides. nocompress falls back to PNG.

avifjpegjpgnocompresspngwebp
// COOL USAGES

Compose anywhere a single URL can reach.

// 01

OG image carousels

Compose 4 product shots into a single 1200×630 og:image. One URL per share — Twitter, LinkedIn and Slack render a richer card without an asset pipeline.

// 02

Before/after pairs

type=row&gap=2 lays two screenshots side-by-side for changelog tweets and PR comments. No design tool, no export step.

// 03

Mood boards

type=classic&cols=2 stitches four lifestyle photos into a Pinterest-style tile. Drop it straight into a category hero — one request, one cache key.

// 04

Multi-photo product hero

Five-image row above the fold without five <img> tags. One URL, one cache hit, immutable for a year.