The ImageDecoder API intends to provide web authors random access to decoded images (as ImageBitmap) for each frame in a given image. The returned ImageBitmap objects can be used for drawing to canvas or WebGL (as well as any other future ImageBitmap use cases). Since the API is not bound to the DOM it may also be used in workers.
Today <img> elements don’t provide access to any frames beyond the first. They also provide no control over which frame is displayed in an animation. Without using a WASM/JS based decoders or message passing from a DOM accessible area, workers have no ability to decode images. As we look to provide audio and video codecs through WebCodecs we intend to provide interfaces for images as well.
Docs: https://developer.mozilla.org/en-US/docs/Web/API/ImageDecoder
Explainers: https://github.com/dalecurtis/image-decoder-api/blob/master/explainer.md