image_compress
Compress images to reduce file size, optionally to a byte budget, with quality, downscale, and format controls.
Instructions
imagepeek: Compress an image, optionally to a byte budget. To change the format only use image_convert. Returns a smaller image or unchanged original, metadata included (returned_original). require_smaller=true: uncharged 422 no_smaller_output. Re-encoding strips EXIF/GPS/XMP/IPTC. Input caps: 10 MB, 40 MP. Output caps: 15 MB, 50 MP. Images are not logged; a result is kept only with output "url" (24 h). Typically 0.5-2 s. Price: USD 0.003. Free: 3 imagepeek calls per IP per UTC day. Docs: https://tanod.dev/learn/image-compress-api.html
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "image_compress"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fit | No | Needs max_bytes. quality keeps size; downscale tries up to 6 smaller same-ratio sizes in one time budget. Downscale needs quality >=10 if set. Check target_met; fit is not guaranteed. | quality |
| url | No | Public http(s) URL of the image (at most 10 MB; private, internal and IP-literal hosts are refused); or use image_base64. | |
| colors | No | PNG palette size. | |
| format | No | Output format; defaults to input. | |
| output | No | base64 (default): inline. url: stored for 24 hours; link, metadata. | base64 |
| quality | No | Target quality, or ceiling with max_bytes. | |
| keep_icc | No | Keep ICC colour profile. | |
| lossless | No | Lossless WebP. | |
| min_side | No | Downscale only: shortest side floor in px. Never enlarges; smaller inputs keep size. | |
| max_bytes | No | Try highest quality that fits. | |
| auto_orient | No | Apply the EXIF orientation first. | |
| progressive | No | Progressive JPEG. | |
| image_base64 | No | The image as standard or url-safe base64 (at most 10 MB decoded; a data:image/...;base64, prefix is fine); or use url. | |
| require_smaller | No | Reject original fallback: 422 no_smaller_output. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | ||
| bytes | No | ||
| error | No | Only on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object. | |
| input | No | ||
| notes | No | ||
| width | No | ||
| format | No | ||
| height | No | ||
| sha256 | No | ||
| source | No | ||
| encodes | No | ||
| final_url | No | ||
| operation | No | ||
| expires_at | No | ||
| source_url | No | ||
| target_met | No | ||
| after_bytes | No | ||
| data_base64 | No | ||
| saved_bytes | No | ||
| saved_ratio | No | ||
| before_bytes | No | ||
| content_type | No | ||
| quality_used | No | ||
| scale_factor | No | ||
| downscale_steps | No | ||
| returned_original | No |