How to use ThumbHash?

Hi @tobimori I’m very interested in using Thumbhash but somehow I don’t find how to use it I’m afraid :see_no_evil:

I’ve tried to replicate your suggestion:

<img
  data-thumbhash="<?= $image->thumbhash() ?>"
  data-src="<?= $image->url() ?>" // Original src attribute will be placed by unlazy
  loading="lazy"
  alt="<?= $image->alt() ?>"
/>

But nothing shows. I then added <script src="https://unpkg.com/unlazy" defer init></script> in my footer and images started to show but it was very slow and no sign of any blur. Simple lazy effect as it already was.

I guess I’m missing something but I couldn’t find any how-to for amateurs like me. :sweat_smile:

Would appreciate very much your help :pray:

Please read through the installation docs again:

Especially the info box :slight_smile:

Sure. I’ll give it a second read, might have been too quick on that. :sweat_smile: