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.
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. |