convert_image
Convert image format
Convert an image to a different format (jpeg, png, webp, tiff, gif, avif). Optionally set quality, strip metadata, enable lossless mode (webp, avif), or tune encoder effort (avif). Instead of a q number you can set quality_target (0-1]: the smallest file with SSIM at or above the target, searched on the worker (jpeg, webp, avif; flat surcharge; outcome reported in X-Pictomancer-Quality-* headers). Optional enhancement modifiers: denoise (1-3), equalize, sharpen (applied denoise -> equalize -> op -> sharpen).
Responses:
200: Processed image binary (Success Response) Content-Type: application/json Content-Type: image/jpeg
Example Response:
"string"Content-Type: image/png
Example Response:
"string"Content-Type: image/webp
Example Response:
"string"Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | No | Quality (1-100). Maps to libvips Q parameter. | |
| strip | No | Strip metadata (EXIF, ICC profile, etc.) from the output. | |
| effort | No | AV1 encoder CPU effort (0-9). Higher = smaller file, slower. Only applies to avif. | |
| format | Yes | Target format: jpeg, png, webp, tiff, gif, or avif. | |
| source | Yes | Image source: a public URL (https://...) or a base64-encoded string (optionally as a data URI like data:image/png;base64,...). | |
| autorot | No | Apply EXIF orientation before converting. Opt-in; default false, which preserves current byte-for-byte behavior. | |
| denoise | No | Median denoise before converting: radius 1-3 (window 3x3 to 7x7). Opt-in; no surcharge. | |
| sharpen | No | Unsharp-mask sharpen after converting (libvips defaults). Opt-in. | |
| delivery | No | ||
| equalize | No | Auto-contrast (histogram equalisation of the value channel; hue and saturation preserved) before converting. Opt-in. | |
| lossless | No | Enable lossless encoding. Only applies to webp and avif. | |
| quality_target | No | Target SSIM (0-1]: the worker searches for the smallest file that still scores at least this. Alternative to q; mutually exclusive with it and with lossless. Only for jpeg, webp, avif. Carries a flat surcharge for the extra encodes. |