wasm-image
blazing fast image processing in WebAssembly
⚠️ Please check the limitations. This is still a work in progress!
Install
npm i wasm-image# or yarn install wasm-image
If you want to use it in a frontend web project, please make sure you use a module bundler that supports WebAssembly, like webpack.
WebAssembly is supported in all modern browsers.
Usage
The small JavaScript wrapper on top of the WASM module is src/image.ts
. As WASM with shared memory is not well supported yet, you need to load the image into the wrapper first:
; ;WasmImg.setImagenew Uint8Arraybuffer;
Note: you can convert a file into a conforming buffer like this:
getImageAsArrayBuffer = ;
Afterwards, you can execute as many operations as you want on the image:
await WasmImg.rotate90;await WasmImg.brighten1;...
Afterwards you can retrieve your image from WebAssembly:
;
Supported image operations
Please check our docs for all available image processing functions.
Limitations
The Rust library used for this project is image. All limitations that are mentioned for this library are obviously also valid for this WASM wrapper.
Please make sure you read the list of supported image formts.
WARNING
The package currently only supports PNG, the rest is a work in progress.
License
MIT