Convert image format
convert_imageConvert a local image to PNG, JPEG, WebP, AVIF, TIFF, or GIF, with quality and lossless controls; JPEG output is flattened onto a chosen background color.
Instructions
Convert a local image to PNG, JPEG, WebP, AVIF, TIFF or GIF. JPEG output is flattened onto the given background color (white by default).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"image": "<image>",
"output_format": "<output_format>"
},
"name": "convert_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| image | Yes | Absolute path to a local image on the machine running this MCP server. | |
| quality | No | Encoder quality (1-100). Applies to JPEG, WebP, AVIF and TIFF output. | |
| lossless | No | Use lossless encoding where supported (WebP and AVIF). | |
| file_name | No | Optional base file name; path separators are not allowed. The actual image format determines the extension. When multiple outputs are produced, -1, -2, ... suffixes are appended. Existing files are never overwritten. | |
| background | No | CSS color used as the background, for example #ffffff or transparent. | |
| output_dir | No | Absolute directory where the output file is saved. Defaults to IMG_OUTPUT_DIR, or ~/img-output. The directory is created automatically. | |
| output_format | Yes | Output image format. PNG, JPEG, WebP, AVIF, TIFF and GIF are supported. | |
| compression_level | No | PNG compression level (0-9); higher is smaller and slower. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| image | Yes | ||
| source | Yes | ||
| details | No | ||
| operation | Yes |