Resize an image
image_resizeResize images to exact dimensions or by percentage, fit within a box using contain, cover, fill, inside, outside, or pad modes, and optionally change format and filter.
Instructions
Resize by width, height, percentage, or to fit a box. Supports contain, cover, fill, inside, outside and pad fit modes, all resampling filters, and optional format change.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fit | No | contain (fit inside, keep ratio), cover (fill and crop), fill (stretch), inside (contain but never enlarge), outside (cover without cropping), pad (contain then pad) | contain |
| 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). | |
| width | No | Target width in pixels. | |
| filter | No | nearest, box, bilinear, hamming, bicubic, lanczos, or auto. | |
| height | No | Target height in pixels. | |
| gravity | No | Anchor for cover cropping or padding, e.g. center, top, bottom-right. | center |
| percent | No | Scale by this percentage of the original. | |
| quality | No | Lossy quality 1-100 (higher is better quality and larger). | |
| background | No | RGBA fill used by pad and rotate. | |
| base64_data | No | Inline image bytes as base64, optionally a data: URI. | |
| only_shrink | No | Never enlarge; leave smaller images untouched. | |
| output_name | No | Override the output filename (a safe name is derived if omitted). | |
| 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). |
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. |