0
$\begingroup$

I would like to convert a given image (say a binary image) into a .svg (or the outline into a path). I figured out that this could be accomplished with Inkscape. However, I need this to be a part of my new addon, meaning it should rely only on blender or python. Any ideas?

$\endgroup$
4
$\begingroup$

Directly from Blender only using python can be done via pypotrace. This is a python package that binds to potrace. potrace is also used by InkScape for converting images to Paths. You will need to include potrace and pypotrace in your add-on.

The result of the trace is a path. You will need to develop to you likings how to convert this to an SVG. But as SVG is just an XML file that will not be that hard.

|improve this answer|||||
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.