Description
SplatHash is a library that compresses any image into a 16-byte placeholder and rebuilds a blurry 32 by 32 preview from it. The encoded result is a 22-character base64url string that can also be stored as a 128-bit integer. It is an alternative to BlurHash and ThumbHash, the placeholder formats often used to show a preview while the full picture loads. The project has implementations for Go, TypeScript and JavaScript, and Python, and says all of them produce bit-for-bit identical hashes, with Go as the reference. The README compares it with ThumbHash and BlurHash on an Intel Core i5-9300H. Decoding takes 0.067 ms, against 0.50 ms for ThumbHash and 6.55 ms for BlurHash, with 7 allocations against 1,168 for ThumbHash. Encoding is slower than ThumbHash, and the author states that the library is tuned for decoding, since decoding runs on every page load while encoding runs once at upload. It uses the Oklab colour space and supports an alpha channel. It suits web and app developers who want small, fixed-size image placeholders.…
Highlights
- 16-byte fixed-size image placeholder
- Go, TypeScript and Python implementations
- Bit-for-bit identical hashes across languages
- Fast decoding to a 32 by 32 preview
- Alpha channel support
Ratings & Reviews
No ratings yet
Be the first to rate Splathash.
People also visit
Splathash FAQ
What is SplatHash?
A library that encodes an image into 16 bytes and decodes it into a blurry 32 by 32 preview.
How do I install it?
For Go, go get github.com/junevm/splathash/src/go. For TypeScript or JavaScript, npm install splathash-ts. For Python, pip install splathash-py.
How does it compare with BlurHash and ThumbHash?
The README's table shows a fixed 16-byte output and faster decoding than both, while ThumbHash encodes faster than SplatHash.
Which implementation is the reference?
Go. The README says the other languages are verified bit-for-bit against it.
Where is the source?
On GitHub at junevm/splathash.
What are the best Splathash alternatives?
Popular alternatives to Splathash include Pep, Image Splitter and Imagecompressor.io. See all Splathash alternatives




