fit_to_spec
Adjusts an image to meet dimension specifications: crops for orientation, upscales to minimum, and downscales to maximum size in a single pass, preserving framing when possible.
Instructions
Transform an image until it satisfies a dimension specification.
Crops to fix the orientation if required, upscales to reach a minimum size, downscales to respect a maximum, and optionally applies a light touch-up -- all in one pass, so the JPEG is re-encoded only once. Images already satisfying a constraint keep their framing.
Example: to produce a square image at least 1000x1000, pass orientation="square" with min_width=1000 and min_height=1000.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| anchor | No | center | |
| backend | No | ||
| quality | No | ||
| upscale | No | ||
| contrast | No | ||
| max_width | No | ||
| min_width | No | ||
| brightness | No | ||
| input_path | Yes | ||
| max_height | No | ||
| min_height | No | ||
| orientation | No | any | |
| output_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |