Expand description
A pure Rust implementation of woltapp/blurhash.
§Encoding
use blurhash::encode;
use image::{GenericImageView, EncodableLayout};
let img = image::open("octocat.png").unwrap();
let (width, height) = img.dimensions();
let blurhash = encode(4, 3, width, height, img.to_rgba().as_bytes()).unwrap();
assert_eq!(blurhash, "LBAdAqof00WCqZj[PDay0.WB}pof");
§Decoding
use blurhash::decode;
let pixels = decode("LBAdAqof00WCqZj[PDay0.WB}pof", 50, 50, 1.0);