Mresize
Bun

method

Image.resize

width: number,
height?: number,
options?: ResizeOptions
): this;

Set target dimensions. Omit height to keep the source aspect ratio.

Referenced types

interface ResizeOptions

  • filter?: Filter

    Resampling kernel.

  • fit?: 'fill' | 'inside'

    "fill" stretches to exactly width×height. "inside" preserves aspect ratio so the result fits within width×height.

  • withoutEnlargement?: boolean

    Never upscale — if the source is already smaller, leave it.