scale_to_fit
Scale an image to fit within specified maximum width and height while preserving its aspect ratio.
Instructions
Scale an image to fit within a bounding box, preserving aspect ratio.
Parameters:
max_width: Maximum allowed width in pixels
max_height: Maximum allowed height in pixels
interpolation: "cubic" (default), "linear", "none"
image_index: Target image index (default 0)
Returns: {status, width, height} — final dimensions after scaling
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| max_width | Yes | ||
| max_height | Yes | ||
| image_index | No | ||
| interpolation | No | cubic |