Get to know MDN better
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
Note: This feature is available in Dedicated Web Workers.
The ImageDecoder interface of the WebCodecs API provides a way to unpack and decode encoded image data.
Creates a new ImageDecoder object.
Returns a boolean value indicating whether encoded data is completely buffered.
ImageDecoder.completed Read onlyReturns a Promise that resolves once complete is true.
ImageDecoder.tracks Read onlyReturns an ImageTrackList object listing the available tracks and providing a method for selecting a track to decode.
ImageDecoder.type Read onlyReturns a string reflecting the MIME type configured during construction.
Indicates if the provided MIME type is supported for unpacking and decoding.
Ends all pending work and releases system resources.
ImageDecoder.decode()Enqueues a control message to decode the frame of an image.
ImageDecoder.reset()Aborts all pending decode() operations.
Given a <canvas> element:
the following code decodes and renders an animated image to that canvas:
| WebCodecs # imagedecoder-interface |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Mar 13, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.