A container for raw RGBA image data.

Implements

  • ImageData

Constructors

Properties

Methods

Constructors

  • Constructs a new image data container.

    Parameters

    • Optionalwidth: number

      The width of the image.

    • Optionalheight: number

      The height of the image.

    • Optionaldata: Uint8ClampedArray

      The image data.

    Returns RawImageData

Properties

colorSpace: PredefinedColorSpace
data: Uint8ClampedArray

The RGBA image data.

height: number

The height of the image.

width: number

The width of the image.

Methods

  • Creates a canvas from this image data.

    Returns HTMLCanvasElement

    The canvas, or null if it couldn't be created.

  • Creates a new image data container.

    Parameters

    • image: ImageData | (new (width?: number, height?: number) => HTMLImageElement)

      An image or plain image data.

    Returns RawImageData

    The image data.