Convert image format
image_convertConvert images between JPEG, PNG, WebP, AVIF, TIFF, GIF, BMP, ICO, and more, while controlling quality, losslessness, and metadata.
Instructions
Convert an image between formats (JPEG, PNG, WebP, AVIF, TIFF, GIF, BMP, ICO, JPEG 2000, QOI, PPM), controlling quality, losslessness and metadata.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | http(s) URL to fetch. Disabled unless PICTOR_ALLOW_NET_FETCH=true. | |
| path | No | Path to the image, relative to an allowed input root (or absolute inside one). | |
| effort | No | Encoder effort: WebP method 0-6 or AVIF speed (inverted). Higher is slower and smaller. | |
| quality | No | Lossy quality 1-100 (higher is better quality and larger). | |
| keep_icc | No | Keep the ICC colour profile even when other metadata is stripped. | |
| lossless | No | Use the codec's lossless mode where supported. | |
| background | No | RGB colour used to flatten transparency when the target has no alpha channel. | |
| base64_data | No | Inline image bytes as base64, optionally a data: URI. | |
| output_name | No | Override the output filename (a safe name is derived if omitted). | |
| progressive | No | Write a progressive JPEG. | |
| return_image | No | Embed the resulting image inline so vision-capable clients can see it. | |
| return_base64 | No | Include the base64 payload in the JSON result for clients without file access. | |
| target_format | No | Target codec, e.g. 'webp', 'png', 'avif'. | webp |
| strip_metadata | No | Remove EXIF/GPS/ICC metadata. Defaults to the server setting (on). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | ||
| input | No | Summary of the source image, when one was read. | |
| notes | No | ||
| steps | No | ||
| metrics | No | Operation-specific measurements (e.g. comparison scores). | |
| outputs | No | ||
| operation | Yes | Tool that produced this result. | |
| sizeChange | No | ||
| inlineImageIncluded | No | True when an image block accompanies this result for vision-capable clients. |