crop
Extract a rectangular sub-region from an image and save it as a new file, leaving the original untouched. Input coordinates are automatically clamped to image bounds.
Instructions
Extract a rectangular sub-region and write it to a NEW file (source unchanged). The region is defined by its top-left corner (x, y) and size (width, height); coordinates are automatically clamped to the image bounds, so partial/out-of-bounds boxes are safe. Returns the output path and the actual box used.
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>",
"out": "<out>",
"x": "<x>",
"y": "<y>",
"width": "<width>",
"height": "<height>"
},
"name": "crop"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | Left edge of the crop region, in pixels (clamped to image bounds). | |
| y | Yes | Top edge of the crop region, in pixels (clamped to image bounds). | |
| out | Yes | Output image path. A new file is created; the source is left untouched. | |
| path | Yes | Source image path. | |
| width | Yes | Width of the crop region, in pixels. | |
| height | Yes | Height of the crop region, in pixels. |