evanw/thumbhash

A very compact representation of an image placeholder

4,206

stars

16

commits

Swift

primary language

May 26, 2024

updated

evanw.github.io/thumbhash/

README

ThumbHash

A very compact representation of a placeholder for an image. Store it inline with your data and show it while the real image is loading for a smoother loading experience. It's similar to BlurHash but with the following advantages:

  • Encodes more detail in the same space
  • Also encodes the aspect ratio
  • Gives more accurate colors
  • Supports images with alpha

Despite doing all of these additional things, the code for ThumbHash is still similar in complexity to the code for BlurHash. One potential drawback compared to BlurHash is that the parameters of the algorithm are not configurable (everything is automatically configured).

A demo and more information is available here: https://evanw.github.io/thumbhash/.

Implementations

This repo contains implementations for the following languages:

These additional implementations also exist outside of this repo:

If you want to add your own implementation here, you can send a PR that puts a link to your implementation in this README.

Contributors

evanw

11 commits

codenoid

1 commits

daibhin

1 commits

markhenrick

1 commits

evanw/thumbhash

A very compact representation of an image placeholder

4,206

stars

16

commits

Swift

primary language

May 26, 2024

updated

evanw.github.io/thumbhash/

README

ThumbHash

A very compact representation of a placeholder for an image. Store it inline with your data and show it while the real image is loading for a smoother loading experience. It's similar to BlurHash but with the following advantages:

  • Encodes more detail in the same space
  • Also encodes the aspect ratio
  • Gives more accurate colors
  • Supports images with alpha

Despite doing all of these additional things, the code for ThumbHash is still similar in complexity to the code for BlurHash. One potential drawback compared to BlurHash is that the parameters of the algorithm are not configurable (everything is automatically configured).

A demo and more information is available here: https://evanw.github.io/thumbhash/.

Implementations

This repo contains implementations for the following languages:

These additional implementations also exist outside of this repo:

If you want to add your own implementation here, you can send a PR that puts a link to your implementation in this README.

Contributors

evanw

11 commits

codenoid

1 commits

daibhin

1 commits

markhenrick

1 commits

Languages

Swift

35.7%

Java

24.1%

Rust

21.6%

JavaScript

18.7%