image_convert
Convert an image to PNG, JPEG, WebP, AVIF, GIF, TIFF, BMP or ICO, with optional quality, background colour, resize (fit modes), rotate/flip, grayscale, DPI and metadata controls. Inputs: JPEG, PNG, WebP, GIF (animated kept for GIF/WebP output), AVIF, TIFF, SVG, BMP. HEIC is not supported. Returns the converted file as base64 text.
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": {
"fileBase64": "<fileBase64>",
"format": "<format>"
},
"name": "image_convert"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dpi | No | Print resolution written into PNG, JPEG, TIFF and BMP | |
| fit | No | How the picture meets width and height. Default inside | |
| blur | No | true for a light blur, or a strength number. | |
| flip | No | Mirror top to bottom | |
| flop | No | Mirror left to right | |
| sizes | No | ICO sizes, from 16, 32, 48, 64, 128, 256 (e.g. '16,32,48'). Default 16,32,48 | |
| width | No | Width (1 to 16384) as a plain number, for example 10. | |
| effort | No | 0 fastest to 10 smallest file (clamped to what the format allows; 'speed' is the same thing) | |
| format | Yes | png, jpeg (or jpg), webp, avif, gif, tiff, bmp or ico; image/... types such as image/webp also work | |
| height | No | Height (1 to 16384) as a plain number, for example 10. | |
| rotate | No | Multiple of 90 degrees clockwise (not for animated images) | |
| quality | No | 0-1 (for example 0.8) or 1-100 (for example 80); JPEG, WebP, AVIF (and TIFF with jpeg compression, palette PNG) | |
| sharpen | No | true for default sharpening, or a strength number. | |
| animated | No | Keep every frame of an animated GIF/WebP when the output is GIF or WebP. Default true | |
| bitDepth | No | BMP: 24 (no transparency) or 32 (keeps transparency) | |
| lossless | No | WebP/AVIF lossless; false on PNG makes a smaller 256-colour palette PNG | |
| grayscale | No | true or false: grayscale. Default false. | |
| autoOrient | No | Turn photos upright from their EXIF rotation flag. Default true | |
| fileBase64 | Yes | The input file as a base64 string, without a data: prefix. | |
| pngPalette | No | PNG: reduce to a 256-colour palette for a smaller file | |
| progressive | No | JPEG progressive scan | |
| stripMetadata | No | Remove EXIF/ICC data. Default true; false keeps it | |
| backgroundColor | No | Fill for transparent areas, e.g. '#ffffff', 'ffffff' or 'white'. Default white for JPEG and 24-bit BMP; for other formats only applied when given | |
| tiffCompression | No | Tiff compression: one of none, lzw, deflate, jpeg. | |
| chromaSubsampling | No | JPEG/AVIF colour detail: 4:4:4 sharpest, 4:2:0 smaller | |
| withoutEnlargement | No | Never make the picture bigger than the original | |
| pngCompressionLevel | No | Png compression level (0 to 9) as a plain number, for example 9. |