Crop an image
image_cropCrop images by pixel box, aspect ratio with gravity anchor, or auto-trim uniform borders to remove unwanted areas and adjust composition.
Instructions
Crop by explicit pixel box, by aspect ratio with a gravity anchor, or auto-trim a uniform border.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| box | No | Explicit (left, top, right, bottom) box in pixels. | |
| url | No | http(s) URL to fetch. Disabled unless PICTOR_ALLOW_NET_FETCH=true. | |
| path | No | Path to the image, relative to an allowed input root (or absolute inside one). | |
| trim | No | Auto-remove a uniform border instead of using box/aspect_ratio. | |
| clamp | No | Clip a box that falls outside the image instead of failing. | |
| gravity | No | Which part to keep: center, top, bottom-left, ... | center |
| quality | No | Lossy quality 1-100 (higher is better quality and larger). | |
| base64_data | No | Inline image bytes as base64, optionally a data: URI. | |
| output_name | No | Override the output filename (a safe name is derived if omitted). | |
| aspect_ratio | No | Crop to this width/height ratio, e.g. 1.0 for square, 1.7778 for 16:9. | |
| return_image | No | Embed the resulting image inline so vision-capable clients can see it. | |
| output_format | No | Output codec: jpeg, png, webp, avif, tiff, gif, bmp, ico, jpeg2000, qoi, ppm. Defaults to the input format. | |
| return_base64 | No | Include the base64 payload in the JSON result for clients without file access. | |
| strip_metadata | No | Remove EXIF/GPS/ICC metadata. Defaults to the server setting (on). | |
| trim_tolerance | No | Colour tolerance for trimming. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | ||
| input | No | Summary of the source image, when one was read. | |
| notes | No | ||
| steps | No | ||
| metrics | No | Operation-specific measurements (e.g. comparison scores). | |
| outputs | No | ||
| operation | Yes | Tool that produced this result. | |
| sizeChange | No | ||
| inlineImageIncluded | No | True when an image block accompanies this result for vision-capable clients. |