Thanks, @Billy Kerr!
I saw the posts on StackOverflow (first and second) and figured out I'll need to use potrace
.
First, convert PNG files to BMP, because potrace
can work only with BMP. It is possible to do using an online site, but it's easier and always free offline.
To process multiple files using potrace
, a bash script is needed:
#!/bin/bash
for filename in ./*.bmp; do
for ((i=0; i<=3; i++)); do
potrace --svg $filename
done
done
The script iterates through all the elements of the current directory and converts them all to SVG using potrace
.
But to use it in the terminal, first make it executable by writing
chmod +x [your filename].sh
and then run it:
./[your filename].sh
After that, the terminal will work a bit, so don't worry, the images are processing - approximately half of a second per image.
-centerline
option).