files/en-us/web/api/imagedata/index.md
{{APIRef("Canvas API")}}{{AvailableInWorkers}}
The ImageData interface represents the underlying pixel data of an area of a {{HTMLElement("canvas")}} element.
It is created using the {{domxref("ImageData.ImageData", "ImageData()")}} constructor or creator methods on the {{domxref("CanvasRenderingContext2D")}} object associated with a canvas: {{domxref("CanvasRenderingContext2D.createImageData", "createImageData()")}} and {{domxref("CanvasRenderingContext2D.getImageData", "getImageData()")}}. It can also be used to set a part of the canvas by using {{domxref("CanvasRenderingContext2D.putImageData", "putImageData()")}}.
ImageData object from a given {{jsxref("Uint8ClampedArray")}} or {{jsxref("Float16Array")}} and the size of the image it contains. If no array is given, it creates an image of a transparent black rectangle. Note that this is the most common way to create such an object in workers as {{domxref("CanvasRenderingContext2D.createImageData", "createImageData()")}} is not available there.unsigned long representing the actual height, in pixels, of the ImageData.unsigned long representing the actual width, in pixels, of the ImageData.ImageData.{{Specifications}}
{{Compat}}