image_crop
Crop an image to a region. unit fraction (default): x, y, w, h are 0 to 1 of the image; unit px: pixels. Reads and writes JPEG, PNG, WebP, AVIF, GIF (first frame), TIFF
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": {
"fileBase64": "<fileBase64>",
"w": "<w>",
"h": "<h>"
},
"name": "image_crop"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| h | Yes | Height of the crop box: 0 to 1 of the height, or pixels with unit px. | |
| w | Yes | Width of the crop box: 0 to 1 of the width, or pixels with unit px. | |
| x | No | Left edge of the crop box: 0 to 1 of the width (default unit), or pixels with unit px. Default 0. | |
| y | No | Top edge of the crop box: 0 to 1 of the height (default unit), or pixels with unit px. Default 0. | |
| unit | No | fraction (default): x, y, w, h are 0 to 1. px: they are pixels. | |
| format | No | png, jpeg (or jpg), webp, avif, gif, tiff, bmp or ico; image/... types also work. Default: the same format as the input | |
| quality | No | 0-1 (for example 0.8) or 1-100 (for example 80); JPEG, WebP, AVIF, and palette PNG | |
| fileBase64 | Yes | The input file as a base64 string, without a data: prefix. | |
| stripMetadata | No | Remove EXIF/GPS/colour-profile data. Default true | |
| backgroundColor | No | Fill for transparent areas (always used for JPEG), e.g. '#ffffff' or 'white' |