Web/API/ImageData/width

From Get docs


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

Syntax

imageData.width

Example

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

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

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
width Chrome

Full support Yes

Edge

Full support 12

Firefox

Full support 14

IE

Full support 9

Opera

Full support 9

Safari

Full support 3.1

WebView Android

Full support Yes

Chrome Android

Full support Yes

Firefox Android

Full support 14

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support Yes

Legend

Full support  
Full support


See also