resize_image
Resize an image
Scale an image by a factor, or fill an exact box. Use 'scale' for uniform scaling, or 'scale_x'/'scale_y' for independent axes (float factors, e.g. 0.5 = half size). Alternatively set 'width'+'height' for fill mode: resize and smart-crop to those exact dimensions in one call (optional 'gravity', default attention). The two modes are mutually exclusive. Optional enhancement modifiers: denoise (1-3), equalize, sharpen (applied denoise -> equalize -> op -> sharpen).
Responses:
200: Processed image binary (Success Response) Content-Type: application/json Content-Type: image/jpeg
Example Response:
"string"Content-Type: image/png
Example Response:
"string"Content-Type: image/webp
Example Response:
"string"Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scale | No | Uniform scale factor applied to both axes (e.g. 0.5 = half size). Use this for simple scaling; use scale_x/scale_y for independent axes. | |
| width | No | Target width in pixels for fill mode: resize and smart-crop to these exact dimensions in one call. Requires height. Mutually exclusive with scale/scale_x/scale_y. Upscaling is allowed. | |
| format | No | Output format: jpeg, png, webp, tiff, gif, or avif. If omitted, the original format is preserved. | |
| height | No | Target height in pixels for fill mode. Requires width. | |
| source | Yes | Image source: a public URL (https://...) or a base64-encoded string (optionally as a data URI like data:image/png;base64,...). | |
| autorot | No | Apply EXIF orientation before resizing. Opt-in; default false, which preserves current byte-for-byte behavior. | |
| denoise | No | Median denoise before resizing: radius 1-3 (window 3x3 to 7x7). Opt-in; no surcharge. | |
| gravity | No | Fill-mode smart-crop strategy: one of ('attention', 'entropy', 'centre'). Only valid together with width and height; defaults to attention. | |
| scale_x | No | Horizontal scale factor (e.g. 0.5 = half width). If only scale_x is given, scale_y defaults to the same value. | |
| scale_y | No | Vertical scale factor (e.g. 0.75 = 75% height). Optional; defaults to scale_x if omitted. | |
| sharpen | No | Unsharp-mask sharpen after resizing (libvips defaults). Opt-in. | |
| delivery | No | ||
| equalize | No | Auto-contrast (histogram equalisation of the value channel; hue and saturation preserved) before resizing. Opt-in. |