ImageDecoder

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The ImageDecoder interface of the WebCodecs API provides a way to unpack and decode encoded image data.

Constructor

ImageDecoder.ImageDecoder()

Creates a new ImageDecoder object.

Properties

ImageDecoder.completeRead only

Returns a boolean indicating whether the data is completely buffered.

ImageDecoder.completedRead only

Returns a Promise that resolves once complete is true.

ImageDecoder.tracksRead only

Returns an ImageTrackList object listing the available tracks and providing a method for selecting a track to decode.

Methods

ImageDecoder.close()

Ends all pending work and releases system resources.

ImageDecoder.decode()

Enqueues a control message to decode the frame of an image.

ImageDecoder.reset()

Resets all states including configuration, control messages in the control message queue, and all pending callbacks.

Specifications

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
ImageDecoder
94
94
No
No
80
No
94
94
No
No
No
No
ImageDecoder
94
94
No
No
80
No
94
94
No
No
No
No
close
94
94
No
No
80
No
94
94
No
No
No
No
complete
94
94
No
No
80
No
94
94
No
No
No
No
completed
94
94
No
No
80
No
94
94
No
No
No
No
reset
94
94
No
No
80
No
94
94
No
No
No
No
tracks
94
94
No
No
80
No
94
94
No
No
No
No
type
94
94
No
No
80
No
94
94
No
No
No
No

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/ImageDecoder