transform_image
Resize images to specified canvas dimensions, adjust content fill proportion, and set background color for transparent or solid backgrounds.
Instructions
Transforms an image to the specified canvas dimensions with optional content proportion and background color.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| width | Yes | Output canvas width in pixels | |
| format | No | Output file format (default: png) | png |
| height | Yes | Output canvas height in pixels | |
| quality | No | Output compression quality, only applies to jpeg and webp (1 = lowest, 100 = highest, default: 95) | |
| proportion | No | How much of the canvas the content fills (0.1–1.0, default: 1 = fills everything) | |
| input_image | Yes | Absolute path to the source image (accepts PNG, JPEG, WebP, TIFF, AVIF) | |
| output_path | Yes | Absolute path of the output file, including name and extension (e.g. /path/to/result.webp) | |
| background_color | No | Canvas background color in hex (e.g. #ffffff). Omit for transparent background. |