Web/API/ImageBitmap/close

From Get docs

This is an experimental technologyCheck the Browser compatibility table carefully before using this in production.


The ImageBitmap.close() method disposes of all graphical resources associated with an ImageBitmap.

Syntax

void ImageBitmap.close()

Examples

var offscreen = new OffscreenCanvas(256, 256);
var gl = offscreen.getContext('webgl');

// ... some drawing using the gl context ...

var bitmap = offscreen.transferToImageBitmap();
// ImageBitmap { width: 256, height: 256 }

bitmap.close();
// ImageBitmap { width: 0, height: 0 } -- disposed

Specifications

Specification Status Comment
HTML Living StandardThe definition of 'close()' in that specification. Living Standard  

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
close Chrome

Full support 52

Edge

Full support 79

Firefox

Full support 46

IE

No support No

Opera

Full support 37

Safari

No support No

WebView Android

Full support 52

Chrome Android

Full support 52

Firefox Android

Full support 46

Opera Android

Full support 37

Safari iOS

No support No

Samsung Internet Android

Full support 6.0

Legend

Full support  
Full support
No support  
No support


See also