image_transform
Apply crop, resize, rotate, flip, grayscale, and format conversion to an image from a file path or URL, then save the result to disk. Specify only the needed operations and output options.
Instructions
Transform an image: crop, resize, rotate, flip, grayscale, and/or convert format.
Operations apply in order: crop -> resize -> rotate -> flip -> grayscale. Only the operations you specify are applied. The result is written to disk.
Args: source: Local file path or direct http(s) URL to an image. output_path: Where to save. Defaults to ~/Downloads/openmedia/. resize_width: Target width in px (0 = derive from height, keep aspect). resize_height: Target height in px (0 = derive from width, keep aspect). crop: "x,y,width,height" crop box in pixels. rotate: Degrees counter-clockwise (expands canvas). flip: "horizontal" or "vertical". grayscale: Convert to grayscale. output_format: Target format: png, jpeg, webp, bmp, tiff, gif (default: keep). quality: Quality for lossy formats (default 90). return_preview: Also return a small preview of the result to the model.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| crop | No | ||
| flip | No | ||
| rotate | No | ||
| source | Yes | ||
| quality | No | ||
| grayscale | No | ||
| output_path | No | ||
| resize_width | No | ||
| output_format | No | ||
| resize_height | No | ||
| return_preview | No |