Transforms raster images into expressive line-art SVG illustrations in under 1.5 seconds. Built with Rust for ultra-fast processing, featuring 4 specialized vectorization backends, GPU acceleration, and an artistic enhancement pipeline for hand-drawn aesthetics.
Algorithm Pipeline
Image loading...
Core Vectorizer
1/3
vectorizer.rs
#[wasm_bindgen]
pub fn vectorize(&self, image_data: &ImageData) -> Result<String, JsValue> {
log::info!("🖼️ Starting vectorization");
// Convert ImageData into an ImageBuffer
let width = image_data.width();
let height = image_data.height();
let data_vec: Vec<u8> = image_data.data().to_vec();
let img_buffer = ImageBuffer::from_raw(width, height, data_vec)
.ok_or_else(|| JsValue::from_str("Failed to create image buffer"))?;
// Build internal configuration
let (config, hand_drawn_cfg) = self.config_manager.build_internal()
.map_err(|e| JsValue::from_str(&format!("Configuration error: {}", e)))?;
// Perform vectorization using the core algorithm
let result = vectorize_trace_low_rgba(&img_buffer, &config, hand_drawn_cfg.as_ref())
.map_err(|e| JsValue::from_str(&format!("Vectorization failed: {}", e)))?;
log::info!("✅ Generated {} bytes of SVG", result.len());
Ok(result)
}
Technology Stack
Rust
SvelteKit
Vercel
Formspark
WebAssembly
Turnstile
TypeScript