We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
If you have a raster image (JPG, PNG, etc.) and want to convert it into a clean, scalable SVG, you can use ImageMagick and Potrace. This method is particularly useful for converting hand-drawn sketches or logos into vector graphics.
Before starting, you need to install ImageMagick and Potrace. These tools work on Linux, macOS, and Windows (via WSL or Cygwin).
Ubuntu/Debian
sudo apt install imagemagick potrace
macOS (Homebrew)
brew install imagemagick potrace
Potrace works with PBM (Portable Bitmap) images, so we first need to convert our image into a black-and-white PBM file using ImageMagick.
convert input.jpg -threshold 50% -monochrome output.pbm
-threshold 50%
ensures a sharp black-and-white conversion.-monochrome
removes grayscale, making it easier for Potrace to trace outlines.
Now that we have a black-and-white PBM image, we use Potrace to trace the bitmap and generate an SVG.
potrace output.pbm -s -o output.svg
-s
outputs an SVG file.-o output.svg
specifies the output file name.
You can open the resulting output.svg
in any vector editing software.
If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts, subscribe use the RSS feed.