Skip to main content

CLI tool for vectorizing raster graphics, written on the basis of the potrace algorithm.

Project description

Vectorvision

License: MIT Documentation Status

Overview

Vectorvision is a tool for vectorizing raster graphics, written on the basis of the potrace (https://potrace.sourceforge.net/) program. A detailed description of the algorithm can be found in the publication about potrace (https://potrace.sourceforge.net/potrace.pdf). For now, available color formats are binary and grayscale, RGB images are firstly converted to grayscale and vectorized. You can convert images of any common format including: png, jpg, jpeg. The output format is SVG.

Features

The program allows you to transfer images from raster formats, e.g. PNG, to the SVG vector format. The program is available from the command line. Features:

  • Support for utility formats: PNG, JPG, JPEG, BMP.
  • Output format: SVG.
  • Optimization of the SVG output file for functionality.
  • Starting the program from the command line.

Tech Stack

The language of this project is Python. These are main libraries that we use:

  • Sphinx
  • PIL
  • numpy
  • shapely
  • pytest

Docs

See the documentation for detailed information: https://vectorvision.readthedocs.io/en/latest/?badge=latest

Installation:

To install this tool run:

pip install vectorvision

Usage:

vectorvision [-h] -i INPUT_PATH [-o OUTPUT_PATH] [--turnpolicy {black,white,left,right,majority,minority}] [--turdsize TURDSIZE] [--alpha-max ALPHA_MAX]
           [--longcurve | --no-longcurve] [--opttolerance OPTTOLERANCE] [--scale SCALE]

vectorvision - CLI tool for raster graphics vectorizing

optional arguments:
-h, --help            show this help message and exit
-i INPUT_PATH, --input-path INPUT_PATH
-o OUTPUT_PATH, --output-path OUTPUT_PATH
--turnpolicy {black,white,left,right,majority,minority}
                        policy which turn take if more than one possibility is legal
--turdsize TURDSIZE   drop all paths smaller than selected turdsize
--alpha-max ALPHA_MAX
                        minimum value of alpha parameter to interpret curve as a corner
--longcurve, --no-longcurve
                        disable optimization step (default: False)
--opttolerance OPTTOLERANCE
                        maximum deviation between original and optimized curves which allow to replace original ones with optimal
--scale SCALE         scale factor for resulting image

The output image will have the same name as input and will be saved in the same directory.

Authors

License

Please check the MIT license that is listed in this repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vectorvision-0.1.2.tar.gz (19.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vectorvision-0.1.2-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

Details for the file vectorvision-0.1.2.tar.gz.

File metadata

  • Download URL: vectorvision-0.1.2.tar.gz
  • Upload date:
  • Size: 19.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.12 Linux/6.5.0-35-generic

File hashes

Hashes for vectorvision-0.1.2.tar.gz
Algorithm Hash digest
SHA256 4a417b63c5fd5c3b900a7da600b30cac42dc38a6ab2dd35fdce22b79d2dda421
MD5 67e7075f1008749411d49765fbc3e382
BLAKE2b-256 df1766ad276c55abbce016fa4b4779aa171f0d975a125deb6801b0efeb100388

See more details on using hashes here.

File details

Details for the file vectorvision-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: vectorvision-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 21.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.12 Linux/6.5.0-35-generic

File hashes

Hashes for vectorvision-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1bcf10aab2dc9cbe037c91f7a5690971b5594122c719ac5b5e9af7a3e1b55647
MD5 7ce6f053e829163c96dc1fe874f476b2
BLAKE2b-256 5e31051736da7df64c29ff410fff3c1d81de01e53bf189dba38baa1f4cf073dc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page