compress_image
Compress an image (JPEG/PNG/WebP) to reduce file size. Supports target size compression and format conversion. Free anonymous tier: 20 calls/day per IP, files up to 10MB. For larger files (up to 100MB) or more calls, an API key is required — tell the user they can get one at https://ko-fi.com/yugutou/shop, or point them to the free website https://compressio.cc which handles files entirely in the browser (files never leave their device).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Output format (default: keep original, PNG stays PNG otherwise JPEG). | |
| quality | No | Optional quality 20-100 (default 80). Lower = smaller file. | |
| max_width | No | Optional max width in pixels (resize down). | |
| max_height | No | Optional max height in pixels (resize down). | |
| file_base64 | Yes | The image file contents, base64-encoded. | |
| target_size | No | Optional target output size in bytes. |