Image Transformations

Transform and optimize images on the fly using URL parameters. Resize, crop, change formats, apply effects—all without modifying your original files.

Resizing & Dimensions

Control the size and fit of your images.

Parameters

widthnumber | 'auto'

Sets the width of the image in pixels.

heightnumber

Sets the height of the image in pixels.

fitstring

How the image should be resized to fit the specified dimensions. scale-down scales only if image is larger than dimensions, contain fits within dimensions maintaining aspect ratio, cover fills dimensions cropping if needed, crop crops to exact dimensions, pad adds padding to fit dimensions.

scale-down
contain
cover
crop
pad
dprnumber

Device Pixel Ratio multiplier. Used for high-density displays.

Format & Quality

Optimize images for speed and quality.

Parameters

formatstring

Output format. auto selects the best format supported by the client (typically WebP or AVIF). baseline-jpeg ensures JPEG compatibility with older browsers. json returns image metadata instead of the image.

auto
avif
webp
jpeg
png
baseline-jpeg
json
qualitynumber | string

Image quality setting. Use numeric values from 1-100 (higher = better quality, larger file size), or predefined levels: high, medium-high, medium-low, low. Lower numeric values reduce file size but may introduce compression artifacts.

high
medium-high
medium-low
low
1-100
compressionstring

Compression speed trade-off.

fast

Effects & Adjustments

Apply visual effects to your images.

Parameters

blurnumber

Applies a Gaussian blur. Value between 1 and 250.

sharpennumber

Increases image sharpness. Value between 0 and 10. Higher values produce sharper images but may introduce artifacts.

brightnessnumber

Adjusts brightness. 1 is original, <1 is darker, >1 is brighter.

contrastnumber

Adjusts contrast. 1 is original, <1 is lower, >1 is higher.

saturationnumber

Adjusts saturation. 1 is original, 0 is grayscale, >1 is more saturated.

gammanumber

Adjusts gamma correction.

Rotation & Orientation

Rotate or flip images.

Parameters

rotatenumber

Rotates the image by the specified degrees.

90
180
270
flipstring

Flips the image horizontally, vertically, or both.

h
v
hv

Cropping & Gravity

Control which part of the image is kept when cropping.

Parameters

gravitystring

Where to focus when cropping. Use auto to automatically find the best spot, face to focus on faces, or a side like left, right, top, or bottom.

auto
face
left
right
top
bottom
zoomnumber

How close to crop around faces. Only works with gravity=face. Use 0 to include more background, 1 to crop tight to faces.

trimstring

Remove borders from edges. Use border to auto-detect and remove borders, or specify pixels as top;right;bottom;left. Example: 10;20;10;20 removes 10px from top/bottom, 20px from left/right.

Styling

Add borders and backgrounds.

Parameters

backgroundstring

Background color for padding or transparent images. Accepts hex codes (URL-encode # as %23, e.g., %23FFFFFF for white) or CSS color names (e.g., white, black, transparent).

bordernumber

Adds a border around the image. Currently only width is supported via query parameters. Specify the border width in pixels (e.g., border=5 for a 5px border). Color customization is not currently available via query parameters.