GitXplorerGitXplorer
g

go-thumbhash

public
78 stars
2 forks
1 issues

Commits

List of commits on branch master.
Verified
ed267c1ad0416602763594ff26f94dd1cbb595e3

rename the module and update dependencies

ggaldor committed 6 months ago
Unverified
a0b5d33d7f95fa87b6440c065a6a8f1bf7cc455c

update go-program

ggaldor committed 10 months ago
Unverified
5f40e920ff450b03da9e7a9875a452806fa89fe0

go mod tidy

ddweymouth committed a year ago
Unverified
3112d670c73a4c46dfee32b5ce827f4c41b80c3b

pool LPQA and fx buffers as well

ddweymouth committed a year ago
Unverified
88c6561596fca5f5f51051a86ea558038447bb5c

scale down large images before encode; pool rgba for reuse

ddweymouth committed a year ago
Unverified
117102ef66c19844ab9e809bc40beb9e703190cd

add large-sunrise to test suite

ddweymouth committed a year 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.