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




This example creates an ImageData object that is 200 pixels wide and 100 pixels tall. Thus, the width property is 200.

let imageData = new ImageData(200, 100);
console.log(imageData.width);  // 200


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

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
widthChrome Full support YesEdge Full support 12Firefox Full support 14IE Full support 9Opera Full support 9Safari Full support 3.1WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 14Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes


Full support  
Full support

See also


Document Tags and Contributors

Contributors to this page: mdnwebdocs-bot, mfluehr, fscholz, libbymc, jpmedley
Last updated by: mdnwebdocs-bot,