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

    Function extractImageDataBuffer

    • Extracts a specific rectangular region of pixels from a larger ImageDataLike source into a new Uint8ClampedArray.

      This is a "read-only" operation that returns a copy of the pixel data.

      Parameters

      • imageData: ImageDataLike

        The source image data to read from.

      • rect: Rect

        A rect defining the region to extract.

      Returns Uint8ClampedArray

      A buffer containing the RGBA pixel data of the region.

    • Parameters

      • imageData: ImageDataLike

        The source image data to read from.

      • x: number

        The starting horizontal coordinate.

      • y: number

        The starting vertical coordinate.

      • w: number

        The width of the region to extract.

      • h: number

        The height of the region to extract.

      Returns Uint8ClampedArray

      A buffer containing the RGBA pixel data of the region.