← Back to release summary

Image Decode API: img.decode()

Category
Graphics
Type
New or changed feature
Status
Enabled by default (Chrome 64)
Intent stage
None

Summary

This change allows web developers to request to decode an img element. The call to a new HTML <img> element’s decode() function returns a promise, which, when fulfilled, ensures that the image can be appended to the DOM without causing a decoding delay on the next frame.

Standards & signals

Docs: https://github.com/whatwg/html/issues/1920 https://github.com/whatwg/html/issues/2037

Samples: https://drive.google.com/file/d/0B5cKk7MxQ2LsUUotR3RuWUlpSXc/view https://drive.google.com/drive/folders/0B5cKk7MxQ2LsNVQzaVVoWHRnVHc

View on chromestatus.com