Spaces:
Sleeping
Sleeping
| title: VectorForge | |
| emoji: ⚡ | |
| colorFrom: purple | |
| colorTo: blue | |
| sdk: gradio | |
| sdk_version: "6.13.0" | |
| app_file: app.py | |
| pinned: true | |
| license: mit | |
| short_description: Image to SVG with Edge Detection & Color Edit | |
| tags: | |
| - image-to-svg | |
| - vector-graphics | |
| - edge-detection | |
| - color-quantization | |
| - svg-converter | |
| # ⚡ VectorForge — Professional Image to SVG Converter | |
| The ultimate web app for converting raster images (JPG, PNG, WEBP) into high-quality, editable SVG vector graphics. | |
| ## ✨ Features | |
| ### 5 Conversion Modes | |
| | Mode | Description | Best For | | |
| |------|-------------|----------| | |
| | 🖤 **Black & White** | Binary tracing for clean silhouettes | Logos, line art, stamps | | |
| | 🎨 **Color** | Full multi-color vectorization | Photos, illustrations, icons | | |
| | ✏️ **Edge Art** | Edge detection → SVG line art | Artistic sketches, technical drawings | | |
| | 🌈 **Smart Color** | Edge outlines + color fills merged | Best of both worlds | | |
| | 🔲 **Posterize** | Flat color reduction before tracing | Pop art, stylized graphics | | |
| ### 🔧 Professional Controls | |
| - **Image Enhancement**: Contrast, brightness, sharpness, denoising | |
| - **6 Edge Detection Methods**: Canny, Sobel, Laplacian, Scharr, Adaptive Threshold, Pencil Sketch | |
| - **Full Tracing Controls**: Speckle filter, corner sharpness, path detail, curve fitting | |
| - **Color Quantization**: KMeans pre-quantization, color precision, layer separation | |
| - **SVG Optimization**: Scour-powered 30-70% file size reduction | |
| ### 🎨 Live Color Editor | |
| - Pick any color in your generated SVG | |
| - Live real-time preview as you change colors | |
| - Grid of color pickers for up to 30 unique colors | |
| ### 📊 Smart Stats | |
| - Path count, file size, unique colors, dimensions | |
| - Transparency-aware preview (checkerboard background) | |
| ## 🛠 Tech Stack | |
| | Component | Library | Purpose | | |
| |-----------|---------|---------| | |
| | **Tracing Engine** | [VTracer](https://github.com/visioncortex/vtracer) | Rust-powered bitmap→vector (0.09s, near SOTA quality) | | |
| | **Edge Detection** | [OpenCV](https://opencv.org/) | Canny, Sobel, Laplacian, Scharr algorithms | | |
| | **Color Quantization** | scikit-learn | MiniBatch KMeans clustering | | |
| | **SVG Optimization** | [Scour](https://github.com/scour-project/scour) | SVG minification & cleanup | | |
| | **UI** | [Gradio 6](https://gradio.app/) | Modern web interface | | |
| ## 📖 How It Works | |
| 1. **Upload** any image (JPG, PNG, WEBP, etc.) | |
| 2. **Choose** your conversion mode | |
| 3. **Tune** settings (or use smart defaults) | |
| 4. **Convert** — instant SVG generation | |
| 5. **Edit** colors live in the browser | |
| 6. **Download** your optimized SVG | |
| ## 🏆 Why VTracer? | |
| Based on the [StarVector benchmark](https://arxiv.org/abs/2312.11556) (SVG-Bench), VTracer achieves: | |
| - **0.954 DinoScore** on SVG-Stack (near best-in-class) | |
| - **0.09 seconds** inference time (800× faster than optimization-based methods) | |
| - Native multi-color support with hierarchical stacking | |
| ## License | |
| MIT | |