Menu

PrivaSVG: image-to-SVG vectorization in the browser with Rust and WebAssembly
📰

PrivaSVG: image-to-SVG vectorization in the browser with Rust and WebAssembly

DEV Community: javascript·Haidar Esber·6 days ago
#gYUYwPYT
#devtojavascript#devto#dev#color#background
Reading 0:00
15s threshold

Most image-to-SVG converters are upload forms: your file goes to a server, gets traced, and comes back. PrivaSVG does the whole job in the browser tab. There is no backend. Here's how it's built, with the parts that were actually tricky.

The pipeline

Raster image -> AI background removal -> Manual retouch -> Upscale (2x / 4x) -> Vectorize (Rust -> WASM) -> SVG

Enter fullscreen mode

Exit fullscreen mode

Every stage is optional except the last, so you can jump straight to vectorization. A bulk page runs up to 50 images through a fixed chain and downloads a single ZIP.

Vectorization: a Rust engine compiled to WebAssembly with wasm-bindgen .

Background removal: @imgly/background-removal , which runs the isnet_fp16 segmentation model on ONNX Runtime Web.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.