image-diff-rs
This project provides an image differencing library that supports PNG
,JPEG
,GIF
,TIFF
,and WebP
formats for Node.js
, Deno
, and Rust
. For more details, please refer to each respective directory.
The code for Node.js
and Deno
is generated using wit-bindgen
and jco
.
- JS: https://github.com/bokuweb/image-diff-rs/tree/main/js
- Wasm: https://github.com/bokuweb/image-diff-rs/tree/main/wasm
- Rust: https://github.com/bokuweb/image-diff-rs/tree/main/core
Demo
img1 | img2 | diff |
---|---|---|
Generate JS code from wasm component.
AR=llvm-ar CFLAGS='--sysroot ../wasi-sdk/share/wasi-sysroot' cargo wasi build --release
wasm-tools component new target/wasm32-wasi/release/image_diff_wasm.wasm -o wasm/component.wasm --adapt wasm/wasi_snapshot_preview1.wasm
jco transpile wasm/component.wasm -o js --name index && mv js/index.js js/index.mjs