Mozilla's getting a new look. What do you think? https://mzl.la/brandsurvey

ImageData Redirect 1

« Canvas API

The ImageData interface represents the underlying pixel data of an area of a <canvas> element. It is created using creators on the CanvasRenderingContext2D object associated with the canvas createImageData() and getImageData()). It can also be used to set a part of the canvas (like with putImageData()).

Properties

ImageData.width Read only
Is an unsigned long representing the actual width, in pixels, of the ImageData.
ImageData.height Read only
Is an unsigned long representing the actual height, in pixels, of the ImageData.
ImageData.resolution Read only
Is a double representing the pixel density of the ImageData. It is used to ensure that an ImageBitmap object generated from an ImageData has the right pixel density.
ImageData.data
Is a Uint8ClampedArray representing a one-dimensional array containing the data in the RGBA order, with integer values between 0 and 255 (included).

Methods

There is no specific method.

Specifications

Specification Status Comment
WHATWG HTML Living Standard Living Standard Added the resolution property.
HTML Canvas 2D Context (W3C) Candidate Recommendation Initial definition.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 4.0 Unknown (3.6) 9.0 9.0 3.1
resolution ? Not supported ? ? ?
Support in workers ? 25 (25) ? ? ?
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support 2.1 3.0 (3.6) ? 10.0 3.2
resolution ? Not supported ? ? ?
Support in workers ? 25.0 (25) ? ? ?

See also

Document Tags and Contributors

 Last updated by: Sheppy,