1

I have this as an example image: example image

I use Python3 and PIL to convert it to a BMP so I can run these commands in a shell ->

Python:

from PIL import Image
img = Image.open("./test3.png").convert("1")
img.save("test3.bmp")

Shell:

mkbitmap test3.bmp -o test3.pbm -g
potrace -b svg test3.pbm -o test3.svg -r 1200 -x 2 --flat

Which results in:output image

Why is it appearing to do edge detection, and how can I make it have the same kind of fill effect on as on the bmp-ed image?

EDIT

Okay - half of the answer is because Potrace does outline tracing and not centerline tracing. Take it from here:

FAQ

Question: Does Potrace provide centerline tracing? Instead of tracing the contour of my image, I just want a single line in the center of each stroke.

Answer: No, Potrace is not designed to do centerline tracing, and for technical reasons, it is unlikely that this will change in the near future. Algorithms used for centerline tracing are quite different than those used for outline tracing; it might be more useful to write a separate program for this purpose. You could try Autotrace, which has such a feature. For Mac users, I have also been told that Super Vectorizer 2 does a good job with centerline tracing.

The other half of the answer is here, but I haven't got a working solution, yet.

Shmack
  • 1,933
  • 2
  • 18
  • 23

0 Answers0