Skip to main content

title: Suresh SVG Converter emoji: 🖼️ colorFrom: blue colorTo: indigo sdk: docker app_port: 7860

🖼️ Suresh SVG Converter

A professional, production-ready Python package for removing backgrounds from images and converting them to high-quality multi-color SVG format.

PyPI version License: MIT

✨ Features

  • Background Removal: AI-powered background removal using rembg with ONNX runtime.
  • Accurate SVG Conversion: High-quality vector tracing using potrace with multi-color support.
  • Color Quantization: Automatically detects dominant colors and creates stratified SVG layers.
  • Dual Interface: Full-featured Command Line Interface (CLI) and a beautiful FastAPI web UI.
  • CPU Optimized: Runs entirely on CPU with no GPU dependency.
  • Fast Performance: Optimized for speed with lazy model loading and K-Means quantization.
  • Batch Processing: Process multiple images at once via CLI.

📋 Requirements

  • Python 3.9+
  • 2GB+ RAM recommended for high-resolution processing.

🚀 Installation

Install the package directly from PyPI:

pip install suresh-svg-converter

🖥️ Usage

Command Line Interface (CLI)

Once installed, use the suresh-svg-converter command anywhere:

Basic usage:

suresh-svg-converter input.jpg

With options:

# Convert with 16 colors and remove background
suresh-svg-converter input.png --remove-bg --colors 16

# Custom output directory
suresh-svg-converter *.png -o ./results

# Batch process multiple files
suresh-svg-converter img1.jpg img2.webp img3.png

CLI Options:

  • --remove-bg, -r: Remove background (default: enabled)
  • --colors, -c: Number of colors for SVG tracing (default: 8)
  • --output-dir, -o: Custom output directory
  • --max-dim: Maximum image dimension for processing (default: 4096)
  • --verbose, -v: Enable verbose logging

Web Interface

Launch the interactive web UI to drag and drop images:

python -m suresh_svg_converter.main

Or use uvicorn directly:

# Locally
uvicorn suresh_svg_converter.main:app --host 0.0.0.0 --port 8000

# On Hugging Face (Port 7860)
uvicorn suresh_svg_converter.main:app --host 0.0.0.0 --port 7860

Then open http://localhost:8000 in your browser.

Programmatic API

Use the converter in your own Python projects:

from suresh_svg_converter.services.svg_convert import SVGConverter
from suresh_svg_converter.services.bg_remove import BackgroundRemover
from PIL import Image

# Load image
img = Image.open("photo.jpg")

# Remove background
remover = BackgroundRemover()
img_no_bg = remover.remove_background(img)

# Convert to SVG with 12 colors
converter = SVGConverter()
svg_path = converter.convert(img_no_bg, "output.svg", num_colors=12)

print(f"Vector saved to: {svg_path}")

📁 Project Structure

suresh_svg_converter/
├── cli.py                   # Main CLI entry point
├── main.py                  # FastAPI web application
├── config.py                # Configuration settings
├── services/
│   ├── bg_remove.py         # Background removal service
│   ├── svg_convert.py       # Multi-color SVG conversion
│   └── image_utils.py       # Image preprocessing
├── routes/
│   └── upload.py            # API routes
└── models/
    └── image_models.py      # Data schemas

⚙️ Configuration

You can customize the default behavior in suresh_svg_converter/config.py:

  • SVG_DEFAULT_COLORS: Default number of color layers (default: 8)
  • MAX_IMAGE_DIMENSION: Resize limit for performance
  • REMBG_MODEL: Choose between u2net, u2netp, etc.

📝 License

MIT License - See LICENSE file for details.

🙏 Acknowledgments


Built with ❤️ for the developer community.

s u r e s h - s v g - c o n v e r t e r

Metadata

Release files for suresh-svg-converter 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for suresh-svg-converter 0.2.1
File Size Uploaded Provenance Actions
suresh_svg_converter-0.2.1.tar.gz 25.6 kB Without provenance Details for suresh_svg_converter-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for suresh-svg-converter 0.2.1
File Interpreter ABI Platform Actions
suresh_svg_converter-0.2.1-py3-none-any.whl Python 3 none any Details for suresh_svg_converter-0.2.1-py3-none-any.whl

Total release size: 50.8 kB

Release files / suresh_svg_converter-0.2.1.tar.gz

Download URL suresh_svg_converter-0.2.1.tar.gz
Size 25.6 kB
Tags Source
SHA-256 checksum
How to use checksums
029d0b0cca40e4d651316034252234102df66f9fd3cb34789b6b59cfca6094dc
BLAKE2b-256 checksum
How to use checksums
a6be10949f2807c5adf0928fd821ec1ae520fb02aae1385e6d450ff6a71b115d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / suresh_svg_converter-0.2.1-py3-none-any.whl

Download URL suresh_svg_converter-0.2.1-py3-none-any.whl
Size 25.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
33b1a7c16123e0ffce123c423d183a5367dd8ef563bae95ca675be4337f490fd
BLAKE2b-256 checksum
How to use checksums
538847a5c7390cd091d2440be1118d5e14df3d720da51afbc308c2517edecf80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Security for suresh-svg-converter 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page