ImageData: width property
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
Note: This feature is available inWeb Workers.
The readonlyImageData.width property returns the numberof pixels per row in theImageData object.
In this article
Value
A number.
Examples
This example creates anImageData object that is 200 pixels wide and 100pixels tall. Thus, thewidth property is200.
js
let imageData = new ImageData(200, 100);console.log(imageData.width); // 200Specifications
| Specification |
|---|
| HTML> # dom-imagedata-width> |