crop_image
Crops an image to a centered aspect ratio or a specified region and writes a new file next to the input unless an output path is provided.
Instructions
Crop an image to a centred aspect ratio (ratio) or to a region (box). Give one of them. Writes a new file next to the input (name-cropped.ext) unless output is given, never replaces a file unless overwrite is true, and returns the path, format and size change.
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>"
},
"name": "crop_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| box | No | Region to keep, as fractions of the image | |
| path | Yes | Absolute path (or ~/…) of the image to read: JPEG, PNG, WebP, AVIF or HEIC. HEIC is written as JPEG unless a format is chosen. | |
| ratio | No | Centred crop, like "1:1" or "16:9" | |
| output | No | Where to write. Default: next to the input, like photo-resized.jpg | |
| quality | No | Quality for lossy output (JPEG, WebP, AVIF), 1–100. PNG ignores it | |
| overwrite | No | Replace an existing output file. Default false |