Coming from Cloudflare Images

Moving from Cloudflare Images

Cloudflare transforms images on a zone it serves. This edge needs only an HTTPS origin, wherever your site is hosted, and the options map almost one to one.

What is different

Cloudflare's transformations run on a zone Cloudflare proxies, through /cdn-cgi/image/ URLs, or on images stored in Cloudflare Images and served by named variants. This edge needs neither: it fetches from any HTTPS origin, and the options become query parameters on your delivery hostname.

Moving, step by step

  1. Create an account and set your origin to where the original images are served from.
  2. Rewrite /cdn-cgi/image/width=800,format=auto/photo.jpg as /photo.jpg?w=800&f=auto on your delivery hostname.
  3. Turn each variant into a preset in the console.
  4. Re-sign any signed URLs with a key from the console.

Cloudflare Images parameters, and what to use here

Cloudflare Images ZawCloud Notes
width, height w, h
format=auto f=auto AVIF, then WebP, from the Accept header.
quality q q=auto picks the lowest quality that still measures as the same image.
dpr dpr dpr=auto reads the browser's client hints.
fit=cover, fit=crop fit=cover
fit=contain, fit=scale-down fit=contain Never enlarges, like scale-down.
fit=pad, background fit=pad, bg
gravity=auto ai_crop With the AI add-on.
gravity=face ai_crop=face With the AI add-on.
gravity with coordinates fp fp=0.5,0.3 rather than 0.5x0.3.
trim with pixel edges crop A rectangle x,y,w,h. Here, trim removes a border of uniform colour.
rotate rotate Multiples of 90.
flip flip h, v or hv.
brightness, contrast, saturation bri, con, sat −100 to 100, where 0 is unchanged, not a factor.
gamma gam A factor in both, where 1 is unchanged.
blur blur 0 to 100, so values need rescaling.
sharpen sharpen On or off, without a strength.
metadata strip On by default, removing everything; strip=false keeps it all.
segment=foreground ai_remove_bg With the AI add-on.
Variants preset Defined in the console.
Signed URL tokens sig, exp, kid, cip HMAC-SHA256 with an expiry, optionally bound to one client address with cip.

Every parameter in the ZawCloud column is described in the API reference. The Cloudflare Images names are as its public documentation gives them; if one no longer matches, tell us.

What has no equivalent here

  • Storing uploaded images.
  • Output that moves.
  • Running a transformation from a Worker.
  • Falling back to the original on an error, as onerror=redirect does.

Try it on your images first

The free tier is enough to point at your origin and compare the two side by side.

Other guides: imgix and Cloudinary .