resize operation generates one or more output images from a single source. You can target explicit pixel widths, scale by a percentage, or cap the output height while resizing to a given width.
Parameters
Must be
"resize".Path to the source image.
Directory where resized files will be written. One file is produced per width.
Array of target widths in pixels. Aspect ratio is preserved. Either
widths or scale_percent is required.Scale factor as a percentage.
50 produces an image at half the original dimensions. Either widths or scale_percent is required.Maximum output height in pixels. When set, a width that would produce a taller image is capped at this value, effectively reducing the output width proportionally.
Output format:
png, jpeg, webp, or avif. Defaults to the source image format.Encode quality for JPEG and WebP outputs. Range: 1–100.
Resampling filter used when downscaling or upscaling.
| Value | Description |
|---|---|
lanczos3 | High-quality Lanczos resampler (default) |
catmullrom | Smooth cubic spline, slightly faster |
default | Engine default (nearest-neighbor for speed) |
When
true, resize is performed in linear light (gamma-decoded) rather than gamma-encoded sRGB. Produces more accurate brightness at edges and gradients.When
true, each output file is also returned as a base64-encoded string in data_base64.Go client
Client.Resize()
Resize a source image to one or more explicit widths.
Client.ResizePercent()
Scale an image by a percentage factor.
Client.ResizeLinear()
Resize using linear RGB color space for higher-quality results.
ResizeJob directly and call Client.Execute():