CLI tool for BlurHash with using of existed implementation.
Encode provided image in the blurhash string
Usage:
encode [flags]
Flags:
-a, --autodetect Autodetect X/Y components numbers
-x, --componentX int Quantity of components by X axis (default 9)
-y, --componentY int Quantity of components by Y axis (default 9)
-h, --help help for encode
-i, --input string Path for the input image
Lets encode the input image.
- Autodetected components ratio:
blurhash-cli encode -a -i ./assets/input.png
- Manual components ratio (for our example its 9x6):
blurhash-cli encode -x 9 -y 6 -i ./assets/input.png
As a result for our input image we will get the next hash string:
rAG+UJS[N4#G?ZGD-;#mWBt-XSIlVa-Et3R5xCS5~pi%9HTWj:#Aa$OEWBRCies:pZNZm:x?E*R*D%tQ-:MyWBozIUs:j?V=XM%Nvo9ZKN%MwJs:
Decode provided blurhash string into image
Usage:
decode [flags]
Flags:
--hash string String is represented BlurHash code
--height int Height of the output image (default 64)
-h, --help help for decode
-o, --output string Path for the output image
--punch int Intensity of colors in resulted image (default 1)
--width int Width of the output image (default 64)
- Manually set the output ratio:
blurhash-cli decode --hash='rAG+UJS[N4#G?ZGD-;#mWBt-XSIlVa-Et3R5xCS5~pi%9HTWj:#Aa$OEWBRCies:pZNZm:x?E*R*D%tQ-:MyWBozIUs:j?V=XM%Nvo9ZKN%MwJs:' --height=480 --width=360 --punch=1 -o ./assets/output.png
So as a result we will get the PNG image.
This app is available in AUR.
Only PNG format is supported now.