tatarize / potrace

Pure Python Port of Potrace
GNU General Public License v2.0
88 stars 15 forks source link

Usage in a Python file to convert a numpy array? #11

Open edent opened 1 year ago

edent commented 1 year ago

I'd like to use this in a Python program which reads a file from disk and then converts it into an SVG.

I don't understand what functions potrace exposes which will let me then save an SVG. I know on the commandline I'd run:

potrace in.ppm -s -o out.svg

What's the equivalent here?

Thanks :-)

tatarize commented 1 year ago

Check the sister library potrace-cli

https://github.com/tatarize/potrace-cli

This does it out of the box and thus shows how it can be done.

tatarize commented 9 months ago

I added a specific example to the readme for how to do this as a single script. It's not as effective as the CLI but serves as a pretty straight-forward example script.