We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

Nossos voluntários ainda não traduziram este artigo para o Português (do Brasil). Junte-se a nós e ajude-nos a fazer o trabalho!
Você também pode ler o artigo em English (US).

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


Creates an ImageData object from a given Uint8ClampedArray and the size of the image it contains. If no array is given, it creates an image of a black rectangle. Note that this is the most common way to create such an object in workers as createImageData() is not available there.


ImageData.data Read only
Is a Uint8ClampedArray representing a one-dimensional array containing the data in the RGBA order, with integer values between 0 and 255 (included).
ImageData.height Read only
Is an unsigned long representing the actual height, in pixels, of the ImageData.
ImageData.width Read only
Is an unsigned long representing the actual width, in pixels, of the ImageData.


Specification Status Comment
HTML Living Standard
The definition of 'ImageData' in that specification.
Living Standard  

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support4 Yes14993.1
Support in workers Yes ?25 ? ? ?
ImageData() constructor42 Yes29 No29 ?
data Yes1214993.1
height Yes1214993.1
width Yes1214993.1
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support Yes Yes ?14103.2 Yes
Support in workers Yes ? ?25 ? ? ?
ImageData() constructor No42 ?29 ? ?4.0
data ? Yes Yes14 Yes Yes Yes
height Yes Yes Yes14 Yes Yes Yes
width Yes Yes Yes14 Yes Yes Yes

See also

Etiquetas do documento e colaboradores

Última atualização por: fscholz,