simdra
SIMD-accelerated 2D canvas, in a Worker.
Overview
simdra is HTML5 Canvas 2D plus a sharp-shaped fluent image-processing surface, both compiled to a single ~500 KB WASM bundle with NEON / SSE / WASM-SIMD code paths. It targets the runtimes that multi-threaded image libraries can't reach: Cloudflare Workers, browser Web Workers, Vercel Edge, Deno Deploy — any V8 isolate that doesn't let you spawn threads.
Why simdra
sharp and @napi-rs/canvas are excellent on a multi-core box, but neither runs in a Worker. CanvasKit runs in the browser but is a ~7 MB Skia port that's too large for the Worker bundle limit and exposes the Skia API rather than HTML5 Canvas. simdra fills that gap with a familiar Canvas surface and a sharp-shape, in roughly 1/14 the size, fitting inside the Worker bundle budget.
| Library | Cloudflare Workers | Browser | Native deps | Bundle |
|---|---|---|---|---|
| sharp | No (needs libvips) | No | yes (libvips) | — |
| @napi-rs/canvas | No (Node-API only) | No | yes (Skia) | — |
| node-canvas | No (Cairo native) | No | yes (Cairo) | — |
| canvaskit-wasm | No (too large) | Yes | no | ~7 MB |
| simdra | Yes | Yes | no | ~500 KB gz |
What it enables
- Smaller, cheaper infrastructure. Eliminate the dedicated image-processing service. Pay per request, not for capacity that sits idle.
- Faster experiences for users. Transforms happen at the edge node nearest the user, not a region a continent away.
- A stronger privacy story. When sensitive uploads can be processed in-browser, the original file never reaches your servers — useful for healthcare, finance, legal, and any product where data residency matters.
- New product surfaces. Dynamic social cards, personalized avatars, on-demand certificates and receipts, branded document exports, in-browser image editors — features that were previously gated by infrastructure cost.
- Simpler operations. One fewer service to deploy, secure, scale, monitor, and pay for.
Why now
Edge compute platforms — Cloudflare Workers, Vercel Edge, Deno Deploy — have changed the cost shape of running code on the internet: pay per request, instant global distribution, no servers to manage. The catch has been that their runtimes are too constrained for traditional image libraries to work. simdra is what makes that capability finally usable for real image workloads.
Three surfaces, one core
| Surface | Shape | Use for |
|---|---|---|
| Canvas 2D | HTML5 immediate-mode | Drawing, programmatic graphics, document rendering |
| MicroSharp | sharp-shaped fluent | Decode, re-encode, resize, image transforms |
| Zig core | Skia-style primitives | Embedding in another Zig project, contributing kernels |
All three call the same Zig types underneath — same SIMD kernels, encoders, and decoders.
Key capabilities
- Drop-in HTML5 Canvas — the API your team already writes in the browser: createCanvas, Path2D, ImageData, DOMMatrix, gradients, patterns.
- sharp-shaped fluent API — the ~22 image operations sharp users already know: resize, rotate, blur, sharpen, modulate, composite, and the rest. No libvips.
- SIMD everywhere — hot loops lowered to NEON on aarch64, SSE on x86, WASM-SIMD in browsers. No thread pools, predictable single-thread latency.
- Runs where sharp can't — ~500 KB gzipped. Cloudflare Workers, Web Workers, Vercel Edge, Deno Deploy. Zero native dependencies, no postinstall.
- Honest, bounded scope — 8-bit × RGBA sRGB. No 16-bit / Lab / CMYK, no WebP / AVIF. Small, auditable, easy to reason about.
When simdra isn't the right fit
- Multi-core servers processing millions of images per hour — use sharp; it wins on a 16-core box.
- GPU-bound workloads — use Skia or WebGPU.
- Wide-gamut, 16-bit, ICC-aware pipelines — use libvips.
- WebP / AVIF / JXL output — not in scope; use sharp.
The target: teams shipping image processing inside a Cloudflare Worker, Vercel Edge function, browser Web Worker, or single-vCPU lambda — anywhere the Node-API libraries don't run.