Image compression size-vs-quality curve
image_compression_curveAnalysis-only tool (no image bytes returned): re-encodes an image at the same fixed 14 quality levels GO AI's browser compressor samples to draw its size-against-quality curve (5, 10, ..., through 100 -- see the qualities in each returned point), for JPEG, WebP or AVIF, and reports the resulting byte size and percent change at each level. The image is first downscaled to fit within maxDimension (default 1600px on the longer side, never enlarged), exactly as the source's working canvas is, then every quality level is encoded one at a time. Because this repeats the encode 14 times, its maxDimension is capped at 2000px -- lower than image_compress's 4000px -- which costs nothing in practice, since the knee of the curve is a property of the image's content and sits in the same place at either size. Use this to find that 'knee' (where size stops dropping much per quality point) for a specific image, or image_compress to actually get the compressed bytes at one chosen quality. Input is base64-encoded image bytes, not a file path or URL.
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": {
"imageBase64": "<imageBase64>"
},
"name": "image_compression_curve"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Format to sample the curve in. Defaults to 'webp', matching the source's own default. | webp |
| imageBase64 | Yes | Base64-encoded source image bytes (not a file path or URL). | |
| maxDimension | No | Longer-side cap in pixels before encoding, aspect preserved, never enlarged. Defaults to 1600, matching the source. Capped at 2000 here (vs 4000 for image_compress) because this tool runs the encode 14 times. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | Yes | Format every point was encoded in. | |
| points | Yes | The 14 fixed sample points, ascending by quality. The 'knee' -- where size stops dropping much per quality point -- is what this tool exists to locate. No image bytes are returned. | |
| working | Yes | The downscaled image every quality level was encoded from. The knee sits in the same place at either size, so this does not distort the curve. | |
| original | Yes | The image as supplied. |