I am often tweaking images and websites as a way to continue my own professional development and to learn something new. Working on something trivial between big tasks also helps clear my thoughts as I work through other things.
I am far from a Photoshop or Gimp expert and I often need to convert a PNG image, such as a logo or similar, to an SVG. So here is how I do it on the Ubuntu command line using Bash:
- Ensure imagemagick is installed.
potracewhich is available via
apt. potrace does not support PNG so I use PNM as an intermediate format.
convertto convert the source PNG to PNM. Read more about convert.
potraceto convert the PNM intermediate file to SVG.
$ convert file.png file.pnm $ potrace file.pnm -s -o file.svg