PNG files can be converted into the Scalable Vector Graphics file format, for use in printing and animation applications. A number of applications can convert . PNG files into . SVG files.
Vector Magic is bar none the world's best PNG to SVG converter. If you need to convert PNG to SVG, look no further.
There is a website where you can upload your image, and see the result.
http://vectormagic.com/home
But if you want to download your svg-image, you need to register. (If you register, you get 2 images for free)
potrace
does not support PNG as input file, but PNM.
Therefore, first convert
from PNG to PNM:
convert file.png file.pnm # PNG to PNM
potrace file.pnm -s -o file.svg # PNM to SVG
potrace -s
=> Output file is SVGpotrace -o file.svg
=> Write output to file.svg
Input file = 2017.png
convert 2017.png 2017.pnm
Temporary file = 2017.pnm
potrace 2017.pnm -s -o 2017.svg
Output file = 2017.svg
ykarikos proposes a script png2svg.sh that I have improved:
#!/bin/bash
File_png="${1?:Usage: $0 file.png}"
if [[ ! -s "$File_png" ]]; then
echo >&2 "The first argument ($File_png)"
echo >&2 "must be a file having a size greater than zero"
( set -x ; ls -s "$File_png" )
exit 1
fi
File="${File_png%.*}"
convert "$File_png" "$File.pnm" # PNG to PNM
potrace "$File.pnm" -s -o "$File.svg" # PNM to SVG
rm "$File.pnm" # Remove PNM
If you want to convert many files, you can also use the following one-line command:
( set -x ; for f_png in *.png ; do f="${f_png%.png}" ; convert "$f_png" "$f.pnm" && potrace "$f.pnm" -s -o "$f.svg" ; done )
See also this good comparison of raster to vector converters on Wikipedia.
A png is a bitmap image style and an SVG is a vector-based graphics design which supports bitmaps so it's not as if it would convert the image to vectors, just an image embedded in a vector-based format. You could do this using http://www.inkscape.org/ which is free. It would embed it, however it also has a Live Trace like engine which will try to convert it to paths if you wish (using potrace). See live trace in adobe illustrator (commericial) is an example:
http://graphicssoft.about.com/od/illustrator/ss/sflivetrace.htm
You may want to look at potrace.
Easy
As you'll see, if you want to do a whole lot of other clever .svg stuff you can do it using Inkscape also.
A non-technical observation: I personally prefer this method over "free" website offerings because, aside from often requiring registration, by uploading the image, in all practical terms, one is giving the image to the website owner.
with adobe illustrator:
Open Adobe Illustrator. Click "File" and select "Open" to load the .PNG file into the program.Edit the image as needed before saving it as a .SVG file. Click "File" and select "Save As." Create a new file name or use the existing name. Make sure the selected file type is SVG. Choose a directory and click "Save" to save the file.
or
online converter http://image.online-convert.com/convert-to-svg
i prefer AI because you can make any changes needed
good luck
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With