Demo: Image Transformation

Application Performance
Images Image Transformation

Description

There are three main methods to transform images:


The Workers method allows for more programmatic customization, as well as more complex transformations, such as drawing overlays and watermarks.

The URL method is simpler to implement, such as using width=auto to automatically resize the image based on the available browser and device information. Optimize images for mobile devices by using lazy loading or eager loading.


Each of these three methods assumes the original images are hosted on an external origin server (e.g., Amazon S3) or in Cloudflare R2.

Alternatively, if you're looking for a managed service with built-in image hosting capabilities, consider using Cloudflare Images.

Workers Code Resizing Example Workers Code Overlay Example EXIF Image Protector Workers Demo

Last Updated: April 2025

Image Transformation via URL Demo

Original Image with characteristics: 3 MB in size, 2419w x 3226h px, 72 resolution.

There are more options.

Transform URL:

Interactive Demo Image for Image Transformations

Lazy Loading Demo

Images below only load when they come into view:

Lazy loaded image 1 Lazy loaded image 2 Lazy loaded image 3

Responsive Images Demo

This image automatically adjusts its size based on the viewport width:

Responsive image demo

How it works:

Image Transformation Settings

Zone Image Transformation Dashboard Settings