Compress image
compress_imageReduce image file size without changing format. Re-encode JPG, WebP, or AVIF at a set quality, or losslessly recompress PNG to shrink file size.
Instructions
Smaller file, same format. jpg/webp/avif re-encode at quality (default 80, mozjpeg for jpg); png is recompressed losslessly.
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": {
"input": "<input>"
},
"name": "compress_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | ||
| output | No | Output file path. Default: next to the input, with a suffix and the right extension. | |
| preview | No | Attach a small JPEG preview to the result (default true). | |
| quality | No | Lossy quality 1-100 (default 80). Ignored for png. |