Tutorial · cloudflare · Published 2026-08-15 · 3 min read
Cloudflare Image Resizing for the edge
Resize and reformat images at the Cloudflare edge with Image Resizing. URL params, format, fit, and the transformation pricing model.
What Image Resizing does
Cloudflare Image Resizing runs a transform on the edge: you request one source image, and Cloudflare produces a resized, reformatted copy without your origin doing any work. It is used to serve a single stored image at many sizes, to convert to a modern format automatically, and to shrink bytes for mobile.
The product was merged into Cloudflare Images and is now also called Image Transformations, but the underlying mechanics are unchanged. You enable it for a proxied zone, then request a derivative URL and Cloudflare derives the image dynamically. Because the result is cached at the edge, repeat visits fetch the transformed copy without re-encoding.
For the on-origin version of the same idea, see image CDN configuration; this guide is the Cloudflare edge path.
Request a derivative
Enable Images or Transformations in the dashboard, then append parameters to an image URL served by the zone:
https://assets.example.com/photo.jpg?width=300&height=200&fit=cover
Key parameters:
| Parameter | Effect |
|---|---|
width / height | Target dimensions in pixels |
fit | cover, contain, scale-down, or pad controls how the image fills the box |
format | webp, avif, jpeg, or auto to let Cloudflare pick |
quality | Compression quality where supported |
dpr | Clamp for higher pixel-density displays |
A responsive pattern sets widths at the breakpoints you need and lets fetchpriority or srcset pick per viewport. Cloudflare caches each transformed variant separately, so generate a stable set of sizes rather than arbitrary ad-hoc dimensions, or the cache fragments and the origin metadata grows. The avif-vs-webp guide helps choose the compression target.
Billing model
The old Image Resizing requirement of a Pro plan no longer applies. Transformations sit in the Cloudflare Images product, and all users are on an Images Free plan by default.
| Metric | Free plan | Paid plan |
|---|---|---|
| Images transformed (remote) | First 5,000 per month free | $0.50 per 1,000 after the first 5,000 |
| Stored images | Not included | $5 per 100,000 per month |
| Delivered images | Not included | $1 per 100,000 per month |
You are billed only once per unique transformation of a given source in a 30-day window; repeats that hit the cache do not accrue. When the free limit is reached, new transformations fail with Cloudflare error 9422 while already-cached ones continue to serve.
Design notes
- Resize for the known breakpoint set. A fixed width list keeps the variant cache clean and predictable.
- Let
format=autonegotiate modern formats, and pair it with a correctVaryso caches store WebP and AVIF versions apart. Correct header handling matters, as covered in the cache control guide. - Start from the largest reasonable source image. Edge resizing cannot add detail a small source lacks, so store a hi-res original and downscale on delivery.
- Budget unique transformations. If the free/monthly count is the limit, gate your sizes so only the sizes real pages use are generated.