Transform raster images (PNG/JPG) into scalable vector graphics (SVG) using LAB color science, AI-enhanced edge detection, and Rust acceleration.
Version: 3.0.0 | Status: Production Ready | License: Proprietary | Last Reviewed: 2025-10-26
- 30-90x Faster - Rust-powered compute core
- 40% Better Colors - LAB color space quantization
- 20% Sharper Edges - AI-enhanced detection
- Smooth Curves - Douglas-Peucker + Bezier fitting
- Batch Processing - Up to 10 files simultaneously
- Production Ready - Docker deployment, REST API
# Clone
git clone https://github.com/bobvasic/vectorizationFourStages.git
cd vectorizationFourStages
# Start with Docker (recommended)
docker-compose up -d
# Or manual setup
npm install
cd backend_processor && pip install -r requirements.txt
cd ../rust_core && cargo build --release && maturin develop --release
cd .. && ./start_fullstack.shAccess:
- Frontend: http://localhost:5173
- API: http://localhost:8000
- API Docs: http://localhost:8000/docs
Cost: $7/month (Backend) + Free (Frontend)
-
Go to Render Dashboard
-
Click New + → Web Service
-
Connect your GitHub repo
-
Configure:
Name: vectorizer-api Runtime: Docker Dockerfile Path: ./Dockerfile Instance Type: Starter ($7/mo) -
Add Persistent Disk (CRITICAL):
Name: vectorizer-storage Mount Path: /app/data Size: 10 GB -
Environment Variables:
PORT=10000 PYTHONUNBUFFERED=1 MAX_FILE_SIZE_MB=10
-
Click Create Web Service
Build time: ~15-20 minutes (first deploy)
-
Click New + → Static Site
-
Connect same GitHub repo
-
Configure:
Name: vectorizer-frontend Build Command: npm install && npm run build Publish Directory: dist -
Environment Variable:
VITE_API_URL=https://vectorizer-api.onrender.com
(Replace with your actual backend URL)
-
Click Create Static Site
Build time: ~2-3 minutes
After backend deploys, update backend_processor/api_server.py:
app.add_middleware(
CORSMiddleware,
allow_origins=[
"https://vectorizer-frontend.onrender.com", # Your frontend URL
"http://localhost:5173", # Local dev
],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)Commit and push to redeploy.
# Test backend
curl https://vectorizer-api.onrender.com/health
# Test frontend
open https://vectorizer-frontend.onrender.com✅ Done! Your app is live.
┌──────────┐ ┌──────────┐ ┌──────────┐
│ React │ ───► │ FastAPI │ ───► │ Rust │
│ Frontend │ │ Backend │ │ Core │
└──────────┘ └──────────┘ └──────────┘
│
┌────┴────┐
Uploads Outputs
Stack:
- Frontend: React 18 + TypeScript + Vite + TailwindCSS
- Backend: FastAPI (Python 3.12) + Uvicorn
- Core: Rust 1.75 + PyO3 + Rayon (parallelism)
- ML: ONNX Runtime (optional)
curl -X POST http://localhost:8000/api/upload \
-F "file=@image.jpg" \
-F "quality=high" \
-F "use_lab=true" \
-F "use_ai=true"
# Response: {"job_id": "abc-123", ...}curl http://localhost:8000/api/status/abc-123
# Response: {"status": "completed", "progress": 100, ...}curl http://localhost:8000/api/download/abc-123 -o output.svgFull API Docs: http://localhost:8000/docs (Swagger UI)
| Level | Colors | Speed | Use Case |
|---|---|---|---|
fast |
16 | 0.8s | Quick previews |
balanced |
32 | 1.5s | Production default |
high |
64 | 2.1s | Print quality |
ultra |
128 | 3.8s | Professional work |
Benchmarked on 512×512 images, Intel i7, 16GB RAM
# Backend
API_HOST=0.0.0.0
API_PORT=8000 # 10000 for Render
MAX_FILE_SIZE_MB=10
ALLOWED_ORIGINS=* # Restrict in production
# Frontend
VITE_API_URL=http://localhost:8000cd backend_processor
python3 test_vectorization.py
# Expected: 14/14 tests passing- Core Functionality - Features, business model
- API Reference - Complete API docs
- Deployment Guide - Docker, production
- Operations Manual - Monitoring, troubleshooting
- File type whitelist (PNG/JPG only)
- Size limit enforcement (10MB default)
- UUID-based filenames (no path traversal)
- CORS configuration
- Docker container isolation
- Input validation (FastAPI + Pydantic)
- 10 uploads/day
- Max 3 concurrent jobs
- All quality levels
- LAB + AI features included
- Unlimited uploads
- Max 10 concurrent jobs
- 50MB file size limit
- API access
- Self-hosted deployment
- Custom limits
- White-label option
- SLA + support
vectorizer_four_stages/
├── backend_processor/ # Python API + processing
│ ├── api_server.py # FastAPI application
│ ├── intelligent_vectorizer.py # Core vectorizer
│ ├── professional_vectorizer.py # OpenCV-based engine
│ └── requirements.txt # Python dependencies
├── rust_core/ # Rust acceleration
│ ├── src/lib.rs # PyO3 bindings
│ └── Cargo.toml # Rust dependencies
├── components/ # React UI components
├── docs/ # Documentation (4 files)
├── Dockerfile # Production build
├── docker-compose.yml # Local development
└── README.md # This file
# Development
npm run dev # Start Vite dev server
python3 backend_processor/api_server.py # Start API
./start_fullstack.sh # Start both
# Production
docker-compose up -d # Start containers
docker-compose logs -f # View logs
docker-compose down # Stop containers
# Testing
python3 backend_processor/test_vectorization.py
cargo test --manifest-path=rust_core/Cargo.toml# Kill process on port 8000
lsof -ti:8000 | xargs kill -9cd rust_core
cargo clean
cargo build --release
maturin develop --releasedocker system prune -a
docker-compose build --no-cacheUpdate allow_origins in backend_processor/api_server.py
| Image Size | Quality | Time | Output |
|---|---|---|---|
| 512×512 | Fast | 0.8s | ~50KB |
| 512×512 | High | 2.1s | ~120KB |
| 1024×1024 | High | 5.4s | ~280KB |
| 2048×2048 | High | 12.7s | ~650KB |
Improvements:
- LAB color: +40% perceptual accuracy
- AI edges: +20% sharpness
- Bezier curves: -70% file size
- Documentation:
/docsdirectory - API Issues: Check API Reference
- Deployment Help: See Deployment Guide
- Bug Reports: GitHub Issues
- Email: support@cyberlinksecurity.com
Proprietary - Commercial use requires Pro/Enterprise license.
- Free tier: Personal use only
- Pro/Enterprise: Commercial use permitted
Created by: Bob Vasic (CyberLink Security)
Version: 3.0.0
Release Date: 2025-10-25
Status: ✅ Production Ready
Engineering Lead: Tim (Senior Enterprise Developer, CyberLink Security)
Built with ❤️ and Rust 🦀
Signature:
Bob Vasic
Founder & CEO
CyberLink Security
2025-10-27