Compress an image
image_compressCall this tool to re-encode an image smaller and report byte counts before/after. quality (default 80) applies to JPEG; for PNG only max_width shrinks it, and the answer names which one worked. Free: sources up to 4 MP.
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_path": "<out_path>"
},
"name": "image_compress"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Name of an image uploaded with image_upload, or one this server wrote earlier | |
| quality | No | JPEG quality 1-100, default 80 | |
| out_path | Yes | Name for the file to write; it comes back as a download link valid for one hour. The extension decides the output format; without a known one the input's format is kept | |
| max_bytes | No | Largest the output may be, in bytes. The server searches JPEG quality down from `quality` until it fits and reports the quality it used. JPEG output only | |
| max_width | No | Scale down so the width is at most this, keeping the aspect ratio. Never scales up | |
| overwrite | No | Replace out_path if it already exists. Default false. Never allows an output to be one of the inputs |