resize
Resize an image to new dimensions and save as a new file, leaving the original untouched. Specify width, height, or both; choose contain, cover, fill, or stretch to control the fit.
Instructions
Resize an image and write the result to a NEW file (the source is never overwritten). Provide width and/or height; if only one is given the other is computed to preserve aspect ratio. 'fit' controls how the image maps into the target box: contain fits inside (no crop), cover fills the box and crops the overflow, fill/stretch forces the exact width x height (aspect ratio may change). Returns the output path and resulting dimensions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fit | No | Mapping mode: contain (fit inside, keep ratio), cover (fill box, crop overflow), fill/stretch (exact size, ratio may change). Default contain. | |
| out | Yes | Output image path. A new file is created; the source is left untouched. | |
| path | Yes | Source image path. | |
| width | No | Target width in pixels. Omit to derive from height and preserve aspect ratio. | |
| height | No | Target height in pixels. Omit to derive from width and preserve aspect ratio. |