convert
Convert an image to a new file format (PNG, JPEG, WEBP, GIF, BMP, TIFF) by specifying an output path. The source remains unchanged; transparency is flattened onto white when needed.
Instructions
Change an image's file format and write it to a NEW file (source unchanged). The target format is inferred from the output file extension (e.g. .webp) unless 'format' is given explicitly; supported targets include PNG, JPEG, WEBP, GIF, BMP, TIFF. When saving to a format without transparency (e.g. JPEG), any alpha channel is flattened onto a white background. Returns the output path and final format.
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": {
"path": "<path>",
"out": "<out>"
},
"name": "convert"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| out | Yes | Output image path. A new file is created; the source is left untouched. | |
| path | Yes | Source image path. | |
| format | No | Optional explicit format (PNG/JPEG/WEBP/GIF/BMP/TIFF). If omitted, it is inferred from the output extension. |