Python SDK for vectorizer.ai
Project description
vectorizer-ai
Python SDK for vectorizer.ai.
What is it?
Convert JPEG and PNG bitmaps to SVG vectors.
Install
$ pip install vectorizer-ai
Usage
Basic
from vectorizer_ai import VectorizerAI
client = VectorizerAI(
api_id="VECTORIZER-AI-API-ID",
api_secret="VECTORIZER-AI-API-SECRET",
mode="production"
)
svg = client.vectorize("/path/to/input.png")
svg.save("/path/to/output.svg")
You can also use:
client.vectorize(image_base64="base64encodedimage==", mode="preview")
# or
client.vectorize(image_url="https://imageurl.com/test.png", mode="test")
Advanced
client.vectorize(
image_path="/path/to/image",
input_max_pixels=100,
processing_max_colors=256
...
)
Reference: https://vectorizer.ai/api
All parameters described in the API spec above replace period (.
) with underscore (_
). For example, if the parameter is input.max_pixels
, the SDK will use input_max_pixels
.
Contributing
Feel free to open a PR for any changes!
Testing
$ python -m unittest discover -s tests -p 'test_*.py'
Made with ❤️ by @mitchbregs
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
vectorizer_ai-2.0.0.tar.gz
(8.3 kB
view hashes)
Built Distribution
Close
Hashes for vectorizer_ai-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a980b0f9025efda24e49cdb92369038aac38db14bde1f7594e7e2645a7b9764d |
|
MD5 | b34efc1e02c8f1db3dd23b3feabd3580 |
|
BLAKE2b-256 | b679e4f221f8e0ede229ba27c1e7b5c907b905c6fbd929621baab67400d48b2a |