Convert or resize an image
convert_imageTransform a public image URL into WebP, AVIF, JPEG, PNG or GIF and optionally resize, crop, rotate, flip, blur, sharpen or grayscale it, returning a 24-hour link.
Instructions
Converts an image at a public URL to WebP, AVIF, JPEG, PNG or GIF, optionally resizing, cropping, rotating, flipping, blurring, sharpening or removing colour. Returns a link valid for 24 hours with the source and output details, and the image itself when it is small enough.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fit | No | `inside` (default, shrink to fit, never enlarge), `cover` (fill and crop), `contain` (fit with padding, see `background`) or `fill` (stretch). | inside |
| url | Yes | Public URL of the image to convert. | |
| blur | No | Gaussian blur passes, 0 to 20. | |
| flip | No | `h`, `v` or `both`. | |
| width | No | Target width in pixels, up to 8000. Omit to derive from the height. | |
| format | No | Output format: `webp` (default), `avif`, `jpeg`, `png`, `gif`, or `keep` to keep the source format. | webp |
| height | No | Target height in pixels, up to 8000. Omit to derive from the width. | |
| rotate | No | Clockwise degrees, 0 to 359. EXIF orientation is always applied first. | |
| quality | No | 1 to 100 for lossy formats. | |
| sharpen | No | When true, applies a sharpening kernel. | |
| grayscale | No | When true, converts to grayscale. | |
| background | No | Six hex digits used to flatten transparency and to pad `contain`. JPEG output is flattened on white when unset. |