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

 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


Specifications

Specification
HTML Standard # dom-imagedata-width-dev

Browser compatibility




Desktop
Mobile



Chrome
Edge
Firefox
Internet Explorer
Opera
Safari
WebView Android
Chrome Android
Firefox for Android
Opera Android
Safari on IOS
Samsung Internet



width
1
12
3.5
9
9
3.1
≤37
18
4
10.1
2
1.0


See also
 ImageData.height ImageData 


Found a problem with this page?

Edit on GitHub
Source on GitHub
Report a problem with this content on GitHub
Want to fix the problem yourself? See our Contribution guide.


Last modified: Apr 3, 2022, by MDN contributors


    
{'path': 'public/docs/dom/imagedata/width.html', 'source': 'DevDocs.IO'}