crop
Extract a chosen region from an image using pixel bounds, an aspect ratio, or exact width and height, with gravity placement and optional non-overwriting output.
Instructions
Crop an image. Pick exactly one mode: box=[left, top, right, bottom] in pixels of the upright image; aspect='16:9' (or '1:1', '4:5') for the largest region with that ratio; width= and height= for a window of exactly that size. For aspect and width/height, gravity picks where the region sits: center (default), top, bottom, left, right, top-left, top-right, bottom-left, bottom-right. Out-of-range boxes are an error, not silently clipped. Output: photo.cropped.jpg unless output= is given; never overwrites unless overwrite=true.
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"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| box | No | ||
| path | Yes | ||
| width | No | ||
| aspect | No | ||
| height | No | ||
| output | No | ||
| gravity | No | center | |
| preview | No | ||
| quality | No | ||
| overwrite | No | ||
| allow_huge | No | ||
| keep_metadata | No |