Skip to main content

ImageData

The ImageData interface represents the underlying pixel data of an area of a <canvas> element.

MDN Reference

Properties

colorSpace

readonly colorSpace: PredefinedColorSpace;

The read-only ImageData.colorSpace property is a string indicating the color space of the image data.

MDN Reference


data

readonly data: ImageDataArray;

The readonly ImageData.data property returns a Uint8ClampedArray or Float16Array that contains the ImageData object's pixel data. Data is stored as a one-dimensional array in the RGBA order.

MDN Reference


height

readonly height: number;

The readonly ImageData.height property returns the number of rows in the ImageData object.

MDN Reference


width

readonly width: number;

The readonly ImageData.width property returns the number of pixels per row in the ImageData object.

MDN Reference