I've finally managed to open-source this project which I created at work, but which is now also in use by Mastodon:
https://github.com/woltapp/blurhash
There is a nice little demo page where you can play with it here:
Toot! already supports it for image placeholders while loading, but other clients should easily be able to include it too.