by nikeee · 4y ago · 0 comments
Wouldn't it be possible to generate a tiny SVG or some CSS that reproduces these gradients?
In that case, basically no decoding step is needed and integration is as easy as setting a CSS style on a div or including an SVG. If the image dimensions are set from the start, the browser can even continue layouting the page before actually drawing the gradients. Letting the browser decode the gradients should also be much faster.
Is there a library that does that?
A CSS Houdini worklet would be another way to represent this in CSS.
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Houdini
I think Blurhash is the way it is because Wolt is an app and not a website, so the decoder is already loaded when you open it. For browser use, SVG would be more straightforward.