galdor/go-thumbhash

A Go implementation of the Thumbhash image placeholder generation algorithm.

Go

136

18 commits

updated Oct 28, 2025

See the code

README

go-thumbhash

Introduction

The go-thumbhash library implements the Thumbhash image placeholder generation algorithm invented by Evan Wallace.

This algorithm is used to calculate a small binary hash representing an image using a Discrete Cosine Transform. The hash can then be used to generate a lossy representation of the original image.

The main use case is progressive loading of a web page containing lots of images, e.g. a photo gallery. Store the hash of each image in your database, and send it in the HTML document. On the client side, use Javascript (e.g. Evan Wallace's library) to generate a placeholder image from the hash. Then load the original image asynchronously.

Thumbhash diagram

Usage

Refer to the Go package documentation for information about the API.

See the thumbhash program for a practical use case.

Licensing

Go-thumbhash is open source software distributed under the ISC license.

go
golang
image-placeholders
thumbhash

galdor/go-thumbhash

A Go implementation of the Thumbhash image placeholder generation algorithm.

Go

136

18 commits

updated Oct 28, 2025

See the code

README

go-thumbhash

Introduction

The go-thumbhash library implements the Thumbhash image placeholder generation algorithm invented by Evan Wallace.

This algorithm is used to calculate a small binary hash representing an image using a Discrete Cosine Transform. The hash can then be used to generate a lossy representation of the original image.

The main use case is progressive loading of a web page containing lots of images, e.g. a photo gallery. Store the hash of each image in your database, and send it in the HTML document. On the client side, use Javascript (e.g. Evan Wallace's library) to generate a placeholder image from the hash. Then load the original image asynchronously.

Thumbhash diagram

Usage

Refer to the Go package documentation for information about the API.

See the thumbhash program for a practical use case.

Licensing

Go-thumbhash is open source software distributed under the ISC license.

go
golang
image-placeholders
thumbhash

Project health

Overall

2.0/10

Maintained

0/10

Code review

0/10
OpenSSF Scorecard

Latest release

v1.1.0 · Oct 28, 2025

Releases this year

1

Significant stargazers

Ayman Bagabas

613 followers · starred Jun 2024

Matt Holt

6,480 followers · starred Sep 2025

Bjørn Erik Pedersen

2,511 followers · starred Jun 2024

Denys

125 followers · starred Dec 2025