imagepeek: crop an image
image_cropCrop an image to a pixel box or aspect ratio, choose a gravity point, and receive the cropped image in base64 or as a download URL.
Instructions
imagepeek: Crop an image to a box or an aspect ratio. To scale instead use image_resize. Returns the image cropped to a box (left, top, width, height; out of bounds is a 422 crop_out_of_bounds) or to an aspect ratio such as 16:9 placed by gravity (center or a side or corner); the reply carries the applied box. Reads PNG, JPEG, WebP, GIF, TIFF, BMP, ICO and AVIF; other formats and images over 40 megapixels are refused (not charged). Output: base64 data_base64, without EXIF, GPS, XMP or IPTC; over 15 MB or 50 megapixels is a 413 (not charged). Images are not logged; a result is kept only with output "url" (24 h). Typically 0.5-2 s. Price: USD 0.002. Free: 3 imagepeek calls per IP per UTC day. Docs: https://tanod.dev/learn/image-crop-api.html
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top | No | Box mode: top edge in pixels. | |
| url | No | Public http(s) URL of the image (at most 10 MB; private, internal and IP-literal hosts are refused); or use image_base64. | |
| left | No | Box mode: left edge in pixels (give left, top, width and height together, or aspect). | |
| width | No | Box mode: crop width in pixels (1-32768). | |
| aspect | No | Instead of a box, e.g. 16:9, with gravity. | |
| format | No | Output format (default: the input's; ICO in, PNG out). | |
| height | No | Box mode: crop height in pixels (1-32768). | |
| output | No | base64 (default): the file comes back inline as base64. url: the file is stored for 24 hours and the reply carries a download link (url, expires_at, bytes, content_type, sha256) instead of the base64, which keeps the file out of your context window. | base64 |
| gravity | No | Aspect mode: the part to keep: center (default), north, south, east, west, northwest, northeast, southwest or southeast. | center |
| quality | No | Encoder quality 1-100 (lossy formats). | |
| auto_orient | No | Apply the EXIF orientation first. | |
| image_base64 | No | The image as standard or url-safe base64 (at most 10 MB decoded; a data:image/...;base64, prefix is fine); or use url. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| box | No | ||
| url | No | ||
| bytes | No | ||
| error | No | Only on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object. | |
| input | No | ||
| notes | No | ||
| width | No | ||
| format | No | ||
| height | No | ||
| sha256 | No | ||
| source | No | ||
| final_url | No | ||
| operation | No | ||
| expires_at | No | ||
| source_url | No | ||
| data_base64 | No | ||
| content_type | No |