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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>",
"out": "<out>"
},
"name": "resize"
}
}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. |