Rollup/Vite plugin that compiles Pixel Bender (PBK) kernels into WebAssembly via Zig, enabling GPU-like image processing in the browser. Version 0.15.2 targets Zig 0.14.x; major/minor versions align with Zig compiler versions. Key differentiators: integrates with Rollup/Vite build pipeline, optionally supports multithreaded WebAssembly workers for non-blocking UI. Requires separate Zig compiler installation. Active development with frequent updates tracking Zig releases.
npm install rollup-plugin-pb2zigNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up Vite with Pb2Zig plugin and applies a Pixel Bender filter to a canvas using named export from .pbk file.
Install Zig following https://ziglang.org/learn/getting-started/ or use ZVM.
Use version matching your Zig compiler (e.g., rollup-plugin-pb2zig 0.15.x for Zig 0.15.x).
When multithreaded: true in plugin options, import { createOutput } instead of createImageData.Ensure .pbk files exist in project and are imported as relative paths (e.g., './filter.pbk').
Check browser compatibility for WebAssembly; polyfills not available.
npm install --save-dev zigar
Use import { createOutput } from './filter.pbk' when plugin has multithreaded: trueEnsure Vite config includes necessary MIME type handling or use built version.