GitXplorerGitXplorer
g

go-thumbhash

public
78 stars
2 forks
1 issues

Commits

List of commits on branch master.
Unverified
ee4844868f0c873b973b988395dc02e879a1d62f

don't assume src img starts at 0,0; use double loop to iter pix

ddweymouth committed a year ago
Unverified
b3ea72a9e72d3b2a714ba9733da0a995c13714c1

update to the last version of go-program

ggaldor committed 2 years ago
Unverified
9da7304894dd15b1680c794e47d4127e72f8d6fa

add encoding tests

ggaldor committed 2 years ago
Unverified
00d80f9c6f3f5805468cd03f5e711399159a31b6

add a diagram to the readme

ggaldor committed 2 years ago
Unverified
c638b5516bde9f89a855918626de8eda363a7782

add godoc annotations

ggaldor committed 2 years ago
Unverified
6c9c2b0b44dc6d4f298ca5e035df071424c89d35

add decoding parameters

ggaldor committed 2 years ago

README

The README file for this repository.

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.