/grid2 credits per image composed · 1-year immutable cacheGrid.
Stitch 2–5 images into one URL — og:image carousels, before/after pairs, mood boards. No asset pipeline.
# 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'Two to five sources. One image out.
Each composition is one /grid URL with 2–5 ?src= params. Same cache key, same edge cost.
Five params, every layout.
Five params drive every composition. Layouts cover the common cases — fall back to custom for everything else.
src2–5 times—DefaultImage URLs to compose. Repeat the param 2–5 times. Invalid sources are dropped silently.
wRequired—DefaultOutput width in pixels.
hRequired—DefaultOutput height in pixels.
sizeOptional—DefaultShortcut that sets both w and h. Explicit w/h override.
dprOptional1DefaultDevice-pixel-ratio multiplier.
typeOptionalautoDefaultLayout algorithm.
autoclassiccolumnrowcolsOptional2DefaultColumn count for classic / column layouts.
gapOptional0DefaultGap in pixels between cells.
formatOptional—DefaultOutput format. When omitted, Accept decides. nocompress falls back to PNG.
avifjpegjpgnocompresspngwebpCompose anywhere a single URL can reach.
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.
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.
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.
Multi-photo product hero
Five-image row above the fold without five <img> tags. One URL, one cache hit, immutable for a year.