imagepeek: resize an image
image_resizeResize an image to a target width, height, or scale factor using fit modes like inside, contain, cover, or fill. Supports PNG, JPEG, WebP, and more.
Instructions
imagepeek: Resize an image. For several sizes in one call use image_thumbnail; for a box or ratio use image_crop. Returns the image resized to width and/or height (or by scale) with fit inside (default), contain (letterboxed on background), cover (centre crop) or fill (stretched), Lanczos by default; never upscaled unless upscale is true (then upscale_prevented says so). 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-resize-api.html
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fit | No | With width and height: inside (default; fit within, keep aspect), contain (fit within, padded to the exact box), cover (fill the box, centre crop) or fill (stretch). | inside |
| 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. | |
| scale | No | Instead of width/height. | |
| width | No | Target width in pixels (1-32768); give width, height, both, or scale. | |
| format | No | Output format (default: the input's; ICO in, PNG out). | |
| height | No | Target 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 |
| quality | No | Encoder quality 1-100 (lossy formats). | |
| upscale | No | Allow output larger than the input. | |
| lossless | No | webp output: lossless encoding (default false). | |
| optimize | No | png output: maximum (slower) compression (default false). | |
| resample | No | Resampling filter: nearest, box, bilinear, hamming, bicubic or lanczos (default). | lanczos |
| background | No | contain padding colour (default transparent / white). | |
| auto_orient | No | Apply the EXIF orientation first. | |
| progressive | No | jpeg output: progressive encoding (default false). | |
| 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 |
|---|---|---|---|
| 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 | ||
| upscale_prevented | No |