All Projects → fpapado → Blurhash Rust Wasm

fpapado / Blurhash Rust Wasm

Licence: mit
A Rust and WASM implementation of the blurhash algorithm

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Blurhash Rust Wasm

Smartcircle
✂️Automatically determine where to crop a circular image out of a rectangular.
Stars: ✭ 29 (-75.63%)
Mutual labels:  image, wasm
React Native Blurhash
🖼️ A library to show colorful blurry placeholders while your content loads.
Stars: ✭ 430 (+261.34%)
Mutual labels:  image, placeholder
Sqip
"SQIP" (pronounced \skwɪb\ like the non-magical folk of magical descent) is a SVG-based LQIP technique.
Stars: ✭ 3,074 (+2483.19%)
Mutual labels:  image, placeholder
V Img Fallback
Vue Image Fallback
Stars: ✭ 43 (-63.87%)
Mutual labels:  image, placeholder
Imagelistview
A .NET listview control for image files with asynchronously loaded thumbnails.
Stars: ✭ 113 (-5.04%)
Mutual labels:  image
Imagecompletion incompletedata
Image completion network using incomplete data
Stars: ✭ 109 (-8.4%)
Mutual labels:  image
Deprecated rust wasm template
Deprecated in favor of rustwasm/wasm-pack-template or rustwasm/rust-webpack-template
Stars: ✭ 108 (-9.24%)
Mutual labels:  wasm
Eleventy Plugin Lazyimages
Eleventy plugin that adds blurry placeholders & lazy loading to your images
Stars: ✭ 108 (-9.24%)
Mutual labels:  placeholder
Pi Rec
🔥 PI-REC: Progressive Image Reconstruction Network With Edge and Color Domain. 🔥 图像翻译,条件GAN,AI绘画
Stars: ✭ 1,619 (+1260.5%)
Mutual labels:  image
Skeletonview
☠️ An elegant way to show users that something is happening and also prepare them to which contents they are awaiting
Stars: ✭ 10,804 (+8978.99%)
Mutual labels:  placeholder
Zooming
🔍 Image zoom that makes sense.
Stars: ✭ 1,538 (+1192.44%)
Mutual labels:  image
Flutter crop
Crop any widget/image in Android, iOS, Web and Desktop with fancy and customizable UI, in pure Dart code.
Stars: ✭ 107 (-10.08%)
Mutual labels:  image
Zoompreviewpicture
拓展性极高类似微信图片和视频浏览,常见应用场景如微信朋友圈照片九宫格和微信聊天图片图片,视频,gif预览
Stars: ✭ 1,576 (+1224.37%)
Mutual labels:  image
Gis
gis (go image server) go 实现的图片服务,实现基本的上传,下载,存储,按比例裁剪等功能
Stars: ✭ 108 (-9.24%)
Mutual labels:  image
Sketch
Sketch 是 Android 上一个强大且全面的图片加载器,支持 GIF,手势缩放以及分块显示超大图片。Sketch is a powerful and comprehensive image loader on Android, with support for GIF, gesture zooming, block display super large image
Stars: ✭ 1,557 (+1208.4%)
Mutual labels:  image
Jhform
JhForm - 自定义表单工具,更加简单,快捷的创建表单、设置页面
Stars: ✭ 108 (-9.24%)
Mutual labels:  image
Kou
A minimal language compiled into wasm bytecode
Stars: ✭ 112 (-5.88%)
Mutual labels:  wasm
React Magnifier
🔍 React image zoom component
Stars: ✭ 116 (-2.52%)
Mutual labels:  image
Bepasty Server
binary pastebin server
Stars: ✭ 111 (-6.72%)
Mutual labels:  image
React Image File Resizer
Resize Local Images with React 🌄 🌅
Stars: ✭ 108 (-9.24%)
Mutual labels:  image

blurhash-wasm

A Rust implementation of the blurhash algorithm.

It is compiled to WebAssembly (WASM), and available on npm as blurhash-wasm.

BlurHash is an algorithm written by Dag Ågren and folks at Wolt (woltapp/blurhash). BlurHash is "a compact representation of a placeholder for an image." It enables you to store that representation in your database. It can then be transferred together with the initial data, in order to decode and show it, before the main image request has finished (or even started).

Online Demo.

Usage in JS

Installation

You will need a package manager, either npm (comes with node) or yarn.

You will also need a bundler, webpack or Rollup, configured for your project.

Then, in a terminal:

npm install blurhash-wasm
# Or, yarn add blurhash-wasm

The demo app source has a complete example of using blurhash-wasm.

decode

import * as blurhash from "blurhash-wasm";

// You can use this to construct canvas-compatible resources
try {
  const pixels = blurhash.decode("LKO2?U%2Tw=w]~RBVZRi};RPxuwH", 40, 30);
} catch (error) {
  console.log(error);
}

encode

Implented, aim to be published in 0.3.0

Usage in Rust

Installation

You will need Rust and Cargo.

Add the version you want to Cargo.toml:

[dependencies]
blurhash-wasm = "0.1.0"

decode

use blurhash_wasm;

// Result<Vec<u8>, blurhash::Error>
let res = blurhash::decode("LKO2?U%2Tw=w]~RBVZRi};RPxuwH", 40, 30);

encode

Implented, aim to be published in 0.3.0

About the setup

Based on the rust wasm-pack template

This template is designed for compiling Rust libraries into WebAssembly and publishing the resulting package to NPM.

Be sure to check out other wasm-pack tutorials online for other templates and usages of wasm-pack.

🚴 Usage

🛠️ Build with wasm-pack build

wasm-pack build

🔬 Test in Headless Browsers with wasm-pack test

wasm-pack test --headless --firefox

🎁 Publish to NPM with wasm-pack publish

wasm-pack publish

🔋 Batteries Included

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].