Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧭 PureBlack Vector Studio

🖼️ Raster → Clean EPS/SVG Vector Converter

Welcome to PureBlack Vector Studio — a powerful Python-based automation tool that converts pure black raster images (PNG/JPG) into clean vector formats (SVG & EPS) using Potrace.
It automatically removes white backgrounds, preserves only black regions, batch processes multiple files, and even merges grouped images into one final EPS layout.

⚠️ Important: This tool works only with black silhouette or line-art images on white backgrounds.
It will NOT work with colorful photographs, shaded portraits, or multi-colored graphics.


Features

  • 🧼 White Background Removal — Keeps only black regions, removes white/near-white automatically.
  • 📄 SVG & EPS Conversion — Converts each image into both vector formats using Potrace.
  • 🧠 Auto Grouping — Files with the same prefix are automatically grouped and merged into a final EPS grid.
  • 🗂️ Organized Outputs
    • output_svg/ → Individual SVG files
    • output_eps/ → Individual EPS files
    • output_groups/ → Grouped & merged EPS files
  • Batch Processing — Convert multiple images at once with a single command.
  • 🖥️ Cross Platform — Works on Windows, macOS, and Linux (with Potrace installed).
  • ✅ Auto CMYK conversion with 300 PPI
  • ✅ Fixed 3000×3000 px canvas size for all outputs
  • ✅ Auto grouping of multiple files into single CMYK EPS (center aligned)
  • ✅ Ghostscript integration for high quality vector output

🧰 Requirements

Before using the tool, make sure you have the following installed:

🐍 1. Python 3.10+

Download & install from: https://www.python.org/downloads/


🧠 2. VS Code (Recommended Editor)

Download from: https://code.visualstudio.com/

➡️ After installation:

  • Open VS Code
  • Install the Python Extension (from Extensions Marketplace)

**3. 👉 Ghostscript Download (Windows/macOS/Linux)

🧭 4. Potrace (Image to Vector Converter)

  • Download from: http://potrace.sourceforge.net/
  • Windows: Extract the ZIP and place potrace.exe into C:\Windows\ OR add it to your System PATH
  • macOS:
    brew install potrace
    

Ubuntu/Debian:

sudo apt install potrace

✅ Verify installation:

potrace --version


📦 5. Python Libraries

Install required libraries with a single command:

pip install -r requirements.txt

Or use the helper script:

python install_dependencies.py

Required libraries:

Pillow

numpy

(optional) customtkinter — for GUI (not required in this version)


🚀 How to Use

  1. 🗂️ Place your black-on-white PNG/JPG files inside the input_images/ folder.

  2. ▶️ Run the backend script:

PureBlack Vector Studio.py

  1. (Optional) Use custom options:

python backend.py --input my_folder --output results --threshold 120

--input → Input folder (default: input_images)

--output → Root output folder (default: current dir)

--threshold → Black detection threshold (0–255). Lower = stricter black filtering.


📤 Output Structure

After processing, you'll find your results in these folders:

📁 output_svg/ → Individual SVG files 📁 output_eps/ → Individual EPS files 📁 output_groups/ → Grouped EPS files (merged grid layouts) 📁 temp_bw/ → Temporary PBM files (auto-cleanable)

👉 Grouping is done automatically by using the filename prefix. For example:

logo_1.png logo_2.png logo_3.png

will be merged into:

output_groups/logo_3_images_final.eps


⚠️ Limitations

❌ Does not support colored photos or shaded portraits — it's made for pure black silhouette/vector source images only.

🧠 Potrace is required for SVG/EPS conversion. Without it, PBM files will be generated but no vectorization will occur.

📏 Large images are supported, but high RAM is recommended.


🧪 Example Workflow

  1. You have these files in input_images/:

bird_1.png bird_2.png logo_1.jpg logo_2.jpg

  1. Run:

python backend.py

  1. You get:

output_svg/

├─ bird_1.svg

├─ bird_2.svg

├─ logo_1.svg

└─ logo_2.svg

output_eps/

├─ bird_1.eps

├─ bird_2.eps

├─ logo_1.eps

└─ logo_2.eps

output_groups/

├─ bird_2_images_final.eps

└─ logo_2_images_final.eps

✅ Done! All black shapes are cleanly converted to vector format.


🧑‍💻 Developer

Built with ❤️ using Python + Potrace

Author: Qaisar Rafique


🌟 Support & Feedback

If you find this tool helpful, consider:

⭐ Starring the repository on GitHub

🐛 Reporting bugs or issues in the Issues tab

💡 Suggesting new features through Pull Requests


📜 License

This project is licensed under the MIT License — free to use and modify.

About

PureBlack Vector Studio — A Python-based automation tool that converts raster images (PNG/JPG) into clean vector files (EPS/SVG). Removes white backgrounds, keeps pure black areas, and merges images automatically using Potrace.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages