Set target dimensions. Omit height to keep the source aspect ratio.
method
Image.resize
width: number,
height?: number,
): this;
Referenced types
interface ResizeOptions
- fit?: 'fill' | 'inside'
"fill"stretches to exactly width×height."inside"preserves aspect ratio so the result fits within width×height.