FastPic

Transforms

Resize, crop, format, and optimize images on the fly via URL parameters.

Demo image
Width800
Height600
Quality85
https://media.fastpic.pro/42d00a45-e45b-405a-950b-88929d855b9a?w=800&h=600&q=85&fmt=auto&fit=cover

How transforms work

When you request media.fastpic.pro/{publicId}?w=800&fmt=webp, the media-proxy fetches the original from storage, applies the transforms with Sharp, and streams the result to the browser. Transformed images are cached at the edge, so repeated requests are served from CDN.

Parameters reference

ParamValuesDescription
w1-2000Output width in pixels.
h1-2000Output height in pixels.
q1-100JPEG/WebP encoder quality, where 100 is lossless.
fmtauto, webp, jpeg, png, avifOutput format. auto picks based on the Accept header (modern browsers get WebP/AVIF).
fitcover, contain, inside, outsideHow to scale the image to fit width/height. cover crops to fill, contain shrinks to fit, inside shrinks but never up-scales, outside grows to fill.

Examples

thumb.ts
// Resize to 800px wide WebP at 85% quality
const src = 'https://media.fastpic.pro/img_a1b2c3d4?w=800&fmt=webp&q=85'

Caching

All transformed images include Cache-Control headers (max-age=2592000, public). Once Cloudflare CDN is in front of media.fastpic.pro (deferred MVP-1), repeated transforms hit the edge cache and never touch our origin.