Convert raster images (PNG, JPG) to high-quality vector formats (SVG, EPS) with CMYK color space support.
- π€ Drag & Drop Upload - Simple, intuitive interface
- π― Adjustable Threshold - Fine-tune black shape detection (0-255)
- π Auto-Scaling - Images centered on 3000Γ3000px canvas
- π¨ CMYK Color Space - Professional print-ready EPS output
- π§© Smart Grouping - Automatically groups images by filename prefix
- π¦ Batch Processing - Process multiple images simultaneously
- π Vector Formats - Outputs both SVG and EPS
- π± Responsive Design - Works on desktop and mobile
- Python 3.11+
- Potrace
- Ghostscript
sudo apt update
sudo apt install python3-pip potrace ghostscriptbrew install python potrace ghostscriptDownload and install:
- Python
- Ghostscript
- Potrace (compile from source or use WSL)
-
Clone/Download this project
cd backend pip install -r requirements.txt python app.py -
Open Frontend
- Open
frontend/index.htmlin your browser - Or use Live Server in VS Code
- Open
-
Process Images
- Upload PNG/JPG files
- Adjust settings
- Click "Convert to Vector"
- Download ZIP with results
image-vectorizer/
βββ backend/
β βββ app.py # Flask API
β βββ requirements.txt # Python packages
β βββ Dockerfile # Container config
β βββ render.yaml # Render deployment
β
βββ frontend/
β βββ index.html # User interface
β βββ style.css # Styling
β βββ script.js # Frontend logic
β
βββ DEPLOYMENT_GUIDE.md # Hosting instructions
βββ README.md # This file
-
Backend:
- Push code to GitHub
- Create new Web Service on Render
- Select Docker environment
- Deploy from repository
-
Frontend:
- Create GitHub repository with
frontend/files - Update
API_URLinscript.js - Enable GitHub Pages in repository settings
- Create GitHub repository with
See DEPLOYMENT_GUIDE.md for detailed instructions.
- Visit your deployed frontend URL
- Check green status indicator (π’)
- Upload images (drag & drop or click)
- Configure options:
- Threshold: Lower = more black detected
- Include EPS: Toggle CMYK EPS output
- Group by Prefix: Merge similar filenames
- Click "Convert to Vector"
- Download ZIP with results
GET /healthResponse:
{
"status": "healthy",
"dependencies": {
"potrace": true,
"ghostscript": true
},
"ready": true
}POST /process
Content-Type: multipart/form-data
Parameters:
- files: Image files (PNG/JPG)
- threshold: int (0-255, default: 120)
- include_eps: bool (default: true)
- group_by_prefix: bool (default: true)
Returns: ZIP file with SVG/EPS outputsExample with curl:
curl -X POST http://localhost:5000/process \
-F "files=@image1.png" \
-F "files=@image2.jpg" \
-F "threshold=120" \
-F "include_eps=true" \
-o output.zipEdit app.py:
BLACK_THRESHOLD = 120 # Default threshold
FINAL_SIZE = (3000, 3000) # Canvas size
PPI = 300 # DPI for EPS
MAX_FILE_SIZE = 10 * 1024 * 1024 # 10MB limitEdit script.js:
const API_URL = 'http://localhost:5000'; // Backend URLDownloaded ZIP contains:
vectorized_outputs.zip
βββ svg/
β βββ image1.svg
β βββ image2.svg
β βββ ...
βββ eps/
β βββ image1.eps (CMYK)
β βββ image2.eps (CMYK)
β βββ ...
βββ groups/
βββ prefix1_final.eps
βββ prefix2_final.eps
Issue: Dependencies missing
Fix: Install potrace and ghostscript
Issue: Wrong API_URL
Fix: Update script.js with correct backend URL
Issue: Cross-origin blocked
Fix: Backend has CORS enabled. Check URL matches.
Issue: Large files or many images
Fix: Reduce file count or upgrade hosting plan
- Upload: User uploads raster images
- Threshold: Convert to black/white at specified threshold
- Trace: Potrace converts bitmap to vector paths
- Color: Ghostscript converts to CMYK color space
- Group: Similar filenames merged into composites
- Scale: All outputs centered on 3000Γ3000px canvas
- Package: Everything zipped and returned
- Small images (<1MB): ~2-5 seconds
- Medium images (1-5MB): ~5-15 seconds
- Large batches (10+ images): ~20-60 seconds
Free tier limits:
- Render: 512MB RAM, shared CPU
- Consider paid tier for production
- β File type validation
- β File size limits (10MB)
- β Secure filename handling
- β CORS protection
- β No data persistence
- β Automatic cleanup
Improvements welcome! Areas to enhance:
- Add more output formats (PDF, AI)
- Real-time preview
- Advanced color space options
- Batch naming templates
- Progress tracking per file
MIT License - feel free to use and modify.
- Potrace: Vector tracing engine
- Ghostscript: PostScript/PDF processing
- Flask: Web framework
- PIL/Pillow: Image processing
Developer: Qaisar Rafique
Phone: 0305-7425107
Need customization? Contact for assistance!
Built with β€οΈ for designers, printers, and vector enthusiasts