Converting PNG files to SVG files

XnConvert Multi Platform - Windows, MacOSX, Linux
Xanadu
Posts: 10
Joined: Fri Jul 22, 2016 7:32 pm

Converting PNG files to SVG files

Postby Xanadu » Sat Oct 29, 2016 3:43 am

Hello, I have a bunch of .png image files that I want to convert to .svg files. In my Google search I understood that your tool will do that, but I have XNconvert (and love it) but svg does not seem to be one of many output options.

How to do?

Thanks!

User avatar
xnview
Author of XnView
Posts: 28086
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Converting PNG files to SVG files

Postby xnview » Sat Oct 29, 2016 12:26 pm

You can convert SVG=>PNG, but not PNG=>SVG. (SVG is a vector format while PNG is a bitmap format.)
Pierre.

Xanadu
Posts: 10
Joined: Fri Jul 22, 2016 7:32 pm

Re: Converting PNG files to SVG files

Postby Xanadu » Sun Oct 30, 2016 7:49 pm

Thanks for the reply, Pierre. Do you know of a workaround? Can I convert a png to something else and then to an SVG, or do you know of any other solution?

cday
XnThusiast
Posts: 1561
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Converting PNG files to SVG files

Postby cday » Sun Oct 30, 2016 8:09 pm

Xanadu wrote:Thanks for the reply, Pierre. Do you know of a workaround? Can I convert a png to something else and then to an SVG, or do you know of any other solution?

The problem is that XnView software doen't support saving to SVG, only reading as shown in the Supported formats link... [Scroll down for the full key, the format of that page could be improved. :wink: ]

But someone may be able to suggest an open source solution... :?:

User avatar
XnTriq
Moderator & Librarian
Posts: 5092
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Converting PNG files to SVG files

Postby XnTriq » Mon Oct 31, 2016 1:30 am

While PNG is a raster graphics format, SVG stands for “scalable vector graphics”.

In order to convert raster to vector graphics, you need special software capable of so-called image tracing.
The free open-source SVG editor Inkscape is one such program. It allows you — among other things — to vectorize raster images.

There are also online services for raster-to-vector conversion. I did a quick test and uploaded logo.png to vectorizer.io. Since SVGs are basically text files, you can copy the following “code” and save it as logo.svg to see the result:

Code: Select all

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="135px" height="102px" viewBox="0 0 1350 1020" preserveAspectRatio="xMidYMid meet">
<g id="layer1" fill="#ca412c" stroke="none">
<path d="M648 836 c-25 -7 -59 -21 -74 -31 -20 -13 -29 -15 -32 -6 -5 16 -47 -30 -60 -66 -8 -24 -7 -32 7 -41 14 -9 13 -11 -8 -11 -21 -1 -23 -4 -17 -33 3 -18 11 -35 17 -38 5 -4 9 -22 8 -41 -3 -41 8 -62 27 -55 8 3 14 2 14 -3 0 -11 78 -64 98 -67 9 -2 24 2 35 8 14 7 17 7 13 -1 -9 -14 3 -14 43 0 35 12 40 24 14 34 -17 6 -17 7 0 20 11 8 26 11 35 8 11 -5 14 -2 9 11 -4 11 -1 19 11 23 9 4 23 13 30 20 19 18 -1 76 -32 92 -16 9 -22 19 -19 32 4 13 0 19 -10 19 -8 0 -17 6 -20 13 -2 6 -8 9 -12 5 -4 -4 -2 -16 6 -25 13 -16 12 -17 -3 -5 -17 13 -99 22 -95 11 1 -4 -5 -15 -14 -25 -9 -11 -20 -41 -24 -67 -6 -44 -8 -47 -20 -30 -22 28 -18 68 11 96 14 14 23 31 19 37 -4 6 4 10 19 10 14 0 26 4 26 8 0 23 128 0 159 -29 12 -11 21 -32 21 -48 0 -15 3 -31 7 -35 9 -9 13 -46 7 -77 -6 -32 -84 -118 -101 -112 -6 2 -14 0 -17 -6 -4 -6 25 -7 76 -4 88 6 127 27 128 66 0 10 7 32 16 49 16 31 12 91 -7 114 -5 7 -9 16 -8 20 9 53 -23 99 -89 129 -20 9 -48 22 -62 29 -33 17 -75 17 -132 2z m-123 -106 c-3 -5 -12 -10 -18 -10 -7 0 -6 4 3 10 19 12 23 12 15 0z m155 -101 c0 -5 6 -7 13 -3 6 4 4 -2 -7 -14 -16 -18 -20 -19 -32 -7 -20 20 -17 35 6 35 11 0 20 -5 20 -11z m113 -34 c-3 -9 -8 -14 -10 -11 -3 3 -2 9 2 15 9 16 15 13 8 -4z m-163 -48 c0 -5 -7 -4 -15 3 -8 7 -15 20 -15 29 1 13 3 13 15 -3 8 -11 15 -24 15 -29z m60 3 c-8 -5 -19 -10 -25 -10 -5 0 -3 5 5 10 8 5 20 10 25 10 6 0 3 -5 -5 -10z m230 -64 c0 -3 -4 -8 -10 -11 -5 -3 -10 -1 -10 4 0 6 5 11 10 11 6 0 10 -2 10 -4z"/>
</g>
<g id="layer2" fill="#fcaf17" stroke="none">
<path d="M715 990 c-3 -5 -28 -10 -55 -10 -56 0 -172 -34 -195 -57 -15 -15 -16 -15 -13 3 2 15 -2 18 -21 16 -33 -5 -71 -31 -71 -48 0 -12 5 -12 30 1 69 36 46 10 -41 -44 -54 -34 -99 -70 -107 -85 -7 -14 -21 -26 -31 -26 -10 0 -31 -17 -47 -37 -15 -21 -36 -46 -46 -56 -19 -18 -26 -83 -8 -72 6 4 10 -7 10 -24 0 -17 5 -31 10 -31 6 0 10 -6 10 -13 0 -7 20 -36 45 -64 52 -59 100 -81 235 -107 109 -22 298 -31 375 -18 39 6 62 6 66 0 9 -14 62 -6 67 11 3 10 -3 12 -29 6 l-34 -6 30 19 c19 12 34 16 41 11 17 -14 53 4 67 31 7 14 21 26 32 28 27 5 57 33 51 48 -3 7 2 15 10 18 17 7 19 33 2 39 -10 4 -10 7 0 18 6 7 12 19 12 26 0 25 -26 12 -85 -44 -69 -65 -128 -93 -193 -93 -26 0 -77 -5 -113 -10 -50 -7 -87 -6 -149 5 -46 8 -86 18 -89 23 -3 4 -31 13 -61 19 -128 27 -163 60 -141 134 18 61 143 180 206 197 26 7 51 10 56 7 5 -4 38 5 74 20 57 22 76 25 165 22 55 -1 100 -1 100 1 0 2 -4 12 -10 22 -9 17 -7 18 22 9 47 -13 57 -11 56 9 -1 9 2 27 6 38 6 19 2 23 -29 28 -19 4 -39 4 -44 1 -5 -3 -17 -2 -26 1 -13 5 -14 9 -3 15 11 7 10 11 -2 19 -20 13 -127 13 -135 0z"/>
<path d="M945 860 c-6 -10 52 -50 110 -74 45 -19 45 -19 45 -5 0 15 -24 34 -82 64 -52 27 -64 30 -73 15z"/>
<path d="M890 842 c0 -5 29 -32 64 -62 36 -29 67 -59 70 -66 7 -19 83 -67 95 -60 19 12 -2 37 -100 116 -91 73 -129 94 -129 72z"/>
<path d="M1212 748 c-11 -13 -25 -35 -31 -50 -7 -19 -15 -26 -26 -22 -10 4 -15 0 -15 -10 0 -14 12 -20 33 -17 4 0 7 -3 7 -9 0 -24 18 -6 38 38 27 61 36 92 24 92 -4 0 -18 -10 -30 -22z"/>
<path d="M1260 744 c0 -17 22 -14 28 4 2 7 -3 12 -12 12 -9 0 -16 -7 -16 -16z"/>
<path d="M1131 580 c-11 -33 2 -41 19 -11 12 24 13 41 1 41 -5 0 -14 -13 -20 -30z"/>
<path d="M1106 442 c-10 -17 -4 -171 8 -180 6 -6 27 -13 46 -17 19 -4 46 -14 58 -22 22 -14 26 -13 49 9 24 23 73 114 73 136 0 7 -4 12 -10 12 -5 0 -32 16 -59 35 -41 30 -56 35 -104 35 -31 0 -58 -4 -61 -8z"/>
<path d="M82 362 c-24 -15 -53 -44 -64 -64 -24 -42 -18 -57 33 -84 15 -8 40 -25 55 -39 15 -14 31 -25 36 -25 5 0 33 26 64 57 51 53 54 59 42 81 -13 26 -100 102 -114 101 -5 0 -28 -13 -52 -27z"/>
<path d="M835 260 c-22 -10 -55 -32 -73 -48 -27 -24 -32 -33 -24 -48 6 -11 18 -38 27 -60 18 -44 90 -104 125 -104 22 0 50 36 50 63 0 11 11 32 25 48 29 36 25 52 -27 97 -21 19 -38 42 -38 53 0 24 -14 24 -65 -1z"/>
<path d="M427 251 c-36 -6 -40 -9 -57 -61 -18 -53 -21 -123 -6 -138 4 -3 30 -7 57 -8 28 -1 53 -5 56 -8 11 -11 60 -6 71 7 5 6 12 55 13 107 4 93 4 94 -21 101 -30 8 -61 8 -113 0z"/>
</g>
</svg>

cday
XnThusiast
Posts: 1561
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Converting PNG files to SVG files

Postby cday » Mon Oct 31, 2016 7:09 am

I see that LibreOffice Draw can also export to SVG, although possibly not the go-to application...

Xanadu
Posts: 10
Joined: Fri Jul 22, 2016 7:32 pm

Re: Converting PNG files to SVG files

Postby Xanadu » Tue Nov 01, 2016 6:15 pm

I want to thank you guys for all the info and advice. Very helpful and it's nice to know there are experts out there!
The plan, at least for now, is to open the .pngs in Illustrator and 'save as' .svg files. That will allow the filenames to follow the svg images and although it will be one-by-one, it will be fast. I'm going to pursue the open source leads in the posts first.

Thanks again fellas!! Best to you.


Return to “XnConvert”

Who is online

Users browsing this forum: No registered users and 5 guests