Image Operations
Complete reference for all supported image transformation operations — resize, format conversion, quality, fit modes, and combination examples.
Image operations are specified in the URL path as comma-separated parameters.
/api/v1/{projectSlug}/{operations}/{imageUrl}?key=...&sig=...Supported Operations
| Operation | Description | Example |
|---|---|---|
w_{value} | Width in pixels (1-8192, integer) | w_800 → 800px wide |
h_{value} | Height in pixels (1-8192, integer) | h_600 → 600px tall |
s_{w}x{h} | Size (width × height), both values must be 1-8192 integers | s_200x200 → 200×200 |
f_{format} | Output format | f_webp, f_avif, f_png, f_jpg |
q_{value} | Quality (1-100, integer) | q_80 → 80% quality |
fit_{mode} | Fit mode | fit_cover, fit_contain, fit_fill |
embed | Embed mode | embed |
_ | No operations (passthrough) | _ |
Supported Formats
Input
JPEG, PNG, WebP, AVIF, GIF
Output
JPEG, PNG, WebP, AVIF
Fit Modes
When both width and height are specified, the fit mode controls how the image is resized:
| Mode | Behavior |
|---|---|
fit_cover | Crop to fill the exact dimensions (default) |
fit_contain | Scale down to fit within the dimensions, preserving aspect ratio |
fit_fill | Stretch to fill the exact dimensions |
Combination Examples
Operations are comma-separated in the URL path:
| Operations | Result |
|---|---|
w_800,f_webp | 800px wide, WebP format |
w_400,h_300,q_85 | 400×300, 85% quality |
s_1200x630,f_avif | 1200×630, AVIF (ideal for OG images) |
w_200,f_webp,q_75 | 200px wide, WebP, 75% quality |
_ | Original image, no transformations |
Notes
- If only
w_is specified, height scales proportionally (and vice versa) s_{w}x{h}is equivalent to specifying bothw_andh_- Quality defaults to the image engine's default if
q_is not specified - Using
_as the operations parameter forwards the original image without processing - Unsupported operation keys return
400(fail-closed validation) embedis a flag operation and must not include a value (useembed, notembed_xxx)
Related Documentation
- API Endpoint — Full endpoint format and authentication
- Next.js Integration — Using operations in your application
Last updated on