Pixel Data JS - v0.40.1
    Preparing search index...

    Function resizePixelData

    • Non-destructively resizes the PixelData32 buffer to new dimensions, optionally offsetting the original content. This operation creates a new buffer. It does not scale or stretch pixels; instead, it crops or pads the image based on the new dimensions.

      Parameters

      • target: PixelData32

        The source pixel data to resize.

      • newWidth: number

        The target width in pixels.

      • newHeight: number

        The target height in pixels.

      • offsetX: number = 0

        The horizontal offset for placing the original image.

      • offsetY: number = 0

        The vertical offset for placing the original image.

      • Optionalout: MutablePixelData32

        output object

      Returns PixelData32

      A new PixelData32 object with the specified dimensions.