resize_image
Resize or crop images to exact dimensions with three modes: fit, fill, and crop. All processing occurs locally.
Instructions
Resize or crop an image to specific dimensions. Supports three modes: fit (preserve aspect ratio, fit within bounds), fill (preserve aspect ratio, cover bounds), crop (center crop to exact size). Works locally with Pillow.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Resize mode: 'fit' (contain within bounds, default), 'fill' (cover bounds), 'crop' (center crop to exact size) | fit |
| width | Yes | Target width in pixels | |
| height | Yes | Target height in pixels | |
| image_path | Yes | Path to the input image file | |
| output_path | No | Path to save the output image (optional, auto-generated if omitted) |