Warning
This project is in early development. The API may change before a stable 1.0 release. Use with caution in production.
This WebAssembly library converts bitmap image data into various resin 3D printer slice formats, optimized for browser-based applications. Similar in functionality to UVTools' converter, this library brings format conversion capabilities directly to web environments.
- 🌐 Browser-first Design: Runs entirely in the browser via WebAssembly
- 🖼️ Multi-format Support: Convert to/from common resin printing formats
- ⚡ SIMD Accelerated: Optimized performance using WebAssembly SIMD
- 🔄 Parallel Processing: Web Worker support for multi-threaded conversions
- 🧹 Zero-dependency: Pure C++ compiled to WASM with clean JavaScript interface
- Raw bitmap data (Uint8Array)
.prz(Phrozen)- ...
npm install uv-slicer-wasmimport { init } from "uv-slicer-wasm";
import wasmUrl from "uv-slicer-wasm/lib/wasm/uv-slicer.wasm?url";
const wasm = await init(wasmUrl);
const result = wasm.encodePrzImage({ data: data, useColorDiffCompression: useColorDifferenceCompression });Typical conversion times on modern browsers:
| Resolution | Format | Single-thread | 4 Workers | SIMD |
|---|---|---|---|---|
| 8K (7680x4320) | .prz | 300ms | 80ms | 30ms |
declare interface EmbindModule {
encodePwsImage(_0: any): any;
encodePw0Image(_0: any): any;
encodePrzImage(_0: any): any;
}
export declare function init(wasmURL: string): Promise<UVSlicerModule>;
export declare type UVSlicerModule = WasmModule & EmbindModule;
declare interface WasmModule {
_main(_0: number, _1: number): number;
}
export { }
git clone https://github.com/your-repo/uv-slicer-wasm.git
cd uv-slicer-wasm
# Build WASM
mkdir build && cd build
emcmake cmake ..
cmake --build . -j32 --clean-first
# Build JS wrapper
npm install
npm run build- Chrome 87+ (with WebAssembly SIMD support recommended)
- Firefox 83+
- Edge 89+
- Safari 14.1+
For best performance, enable WebAssembly SIMD support in your browser flags.
MIT License
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
For issues or feature requests, please file an issue on our GitHub repository.