Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ThumbHash for image placeholders #1217

Open
JacobDB opened this issue May 15, 2024 · 3 comments
Open

Add support for ThumbHash for image placeholders #1217

JacobDB opened this issue May 15, 2024 · 3 comments
Labels
[Plugin] Image Placeholders Issues for the Image Placeholders plugin (formerly Dominant Color Images) [Type] Enhancement A suggestion for improvement of an existing feature

Comments

@JacobDB
Copy link

JacobDB commented May 15, 2024

Feature Description

ThumbHash is an algorithm that generates a very low resolution approximation of an image in tiny file sizes. It'd be nice to be able to lazy load using this as the placeholder.

https://evanw.github.io/thumbhash/

@westonruter
Copy link
Member

westonruter commented May 15, 2024

Essentially an improvement over the dominant color currently used in the Image Placeholders plugin? I seem to recall this or blurhash being discussed previously:

In that last message, @pbearne says:

We found that blurhash wasn't a good fit and just creating a primary color was much better

I'm not sure why I wasn't a good fit at that time 2 years ago. Maybe this has changed? Maybe because https://github.com/kornrunner/php-blurhash requires PHP 7.3+? If that is the reason, maybe it could be a progressive enhancement over the dominant color if still on PHP 7.2. But eventually the PHP version will be bumped anyway.

@westonruter westonruter added [Plugin] Image Placeholders Issues for the Image Placeholders plugin (formerly Dominant Color Images) [Type] Enhancement A suggestion for improvement of an existing feature labels May 15, 2024
@pbearne
Copy link
Contributor

pbearne commented May 15, 2024

When we were looking at this all the other options needed some client-side JS or bloated the HTML
we didn't look at thumbhash

Looking at the code example we could look at offering this as an option with the dominant color plugin as it is all server-side
https://github.com/SRWieZ/thumbhash

@swissspidy
Copy link
Member

FWIW, BlurHash can be turned into CSS gradients that look approximately the same. I'm doing that for https://github.com/swissspidy/media-experiments and the result is a nice improvement over just a dominant color. Also, everything is done client-side, so the PHP version requirement is not relevant.

ThumbHash does sound interesting though, I'm gonna try integrating that in Media Experiments as well and do some comparison with BlurHash.

The image placeholders plugin here is a bit unmaintained right now, so I'm not sure it's worth spending too much time on implementing at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Plugin] Image Placeholders Issues for the Image Placeholders plugin (formerly Dominant Color Images) [Type] Enhancement A suggestion for improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

4 participants