BlurHash applies a simple DCT transformation to the image data, retaining only the first few components, and then encodes these components using base 83 encoding with the JSON character set, HTML:
eTGu,l%Mxu-;t7~qxut7t7ofRjWBt7IUWBRjofWBRjj]-;WCIoxut7
You can then perform a reverse conversion to sRGB space over the string.
You can read more about the algorithm here.
You make an http-request to the service, passing in the url of the request a link to your image, as well as x and y parameters (values from 1 to 9) - the number of displayed components.
http://localhost:3333?image_url=https://imgproxy.com/imageurl&x=1&y=4
{
"blur_hash": "eTGu,l%Mxu-;t7~qxut7t7ofRjWBt7IUWBRjofWBRjj]-;WCIoxut7"
}
docker run -d -p 3333:3333 ghcr.io/dev-family/blurhash:1.0.0
blurhash:
image: ghcr.io/dev-family/blurhash:1.0.0
ports:
- "3333:3333"