resize_image
Resize images by specifying dimensions or scale factor while preserving aspect ratio. Adjust width, height, or scale to modify image size for different requirements.
Instructions
Resize an image by dimensions or scale factor.
Provide width/height, or a scale factor (e.g. 0.5 for half size). By default, aspect ratio is preserved. If only width or height is given, the other dimension is calculated automatically.
Args: path: Absolute path to the image file. width: Target width in pixels. height: Target height in pixels. scale: Scale factor (e.g. 0.5 = half, 2.0 = double). keep_aspect_ratio: Preserve aspect ratio when both width and height given. output_path: Where to save. Defaults to _resized. next to input.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| width | No | ||
| height | No | ||
| scale | No | ||
| keep_aspect_ratio | No | ||
| output_path | No |