-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
Why not just wrap the decoded UInt8ClampedArray straight into a Blob of the appropriate bitmap mime-type and URL.createObjectUrl(blob) (making sure to appropriately URL.revokeObjectUrl on hash change or unmount) to create an image URL for a standard img tag (or anywhere an image source can be used such as CSS background-url)? It allows you more style options in CSS over the hash, and it makes it easier to swap in a real URL later when things have "loaded" without changing so many DOM elements in the process. Canvas seems like overkill for rendering the BlurHash in most scenarios to me, but maybe I'm missing something?
Blobs should be supported everywhere that UInt8ClampedArray is, so it doesn't seem like a compatibility issue to me.
Metadata
Metadata
Assignees
Labels
No labels