Results 1 to 6 of 6

Thread: Program to Convert PNG to SVG files ??

  1. #1

    Smile Program to Convert PNG to SVG files ??

    Hi,

    I'm searching for a program to convert over 1000 PNG-files to SVG-files .

    I know you can use Phatch for converting but it can not convert png to svg.
    Another option is open the png-files with inkscape and save as svg-files but that shall take
    years to do because like i said there are over 1000 files to do.

    Is there somebody that can help me with this problem?

    Greetings ,
    Qbashi

  2. #2
    Join Date
    Feb 2009
    Location
    Hamburg, Germany
    Posts
    17

    Default Re: Convert PNG to SVG files

    qbashi wrote:
    > I'm searching for a program to convert over 1000 PNG-files to SVG-files


    Sorry to say so, but it is unlikely that you will find such an application.
    And if you do its usage most likely won't make much sense.

    You might want to think again about the differences between raster and
    vector graphics. They contain totally different content. Creating a vector
    graphic (".svg") that contains a small texture taken from a raster graphic
    (".png") might technically be possible. Where what for ? You will not be
    able to use it like a real vertor graphic, since you cannot scale it, which
    is the main point for using vector graphics.

    arkascha

  3. #3
    Join Date
    Sep 2008
    Location
    London
    Posts
    47

    Default Re: Convert PNG to SVG files

    What is explained by arkasha is true : this conversion does not make much sense. However it is still possible with Image Magick. Group your images in a directory and create the following small script (and make it executable) :

    #!/bin/sh

    # convert a series of *.png images in *.svg
    for x in `ls -1 *.png`
    do
    y=`echo $x | cut -d "." -f1`
    echo "convert $x into $y.svg"
    convert $x $y.svg
    done

    exit 0

    It will convert all your png into svg. But as shown on this example the difference in size may look a bit stupid :

    -rw-rw-r-- 1 bz users 33131 Jan 15 10:13 floor_plan.png
    -rw-rw-r-- 1 bz users 40878977 Jan 15 10:18 floor_plan.svg

  4. #4
    Join Date
    Mar 2009
    Location
    sri mayapur, west bengal, india
    Posts
    958

    Default Re: Convert PNG to SVG files

    On Sun, 15 Jan 2012 15:39:52 +0530, Arkascha
    <arkascha@no-mx.forums.opensuse.org> wrote:

    > qbashi wrote:
    >> I'm searching for a program to convert over 1000 PNG-files to SVG-files

    >
    > Sorry to say so, but it is unlikely that you will find such an
    > application.
    > And if you do its usage most likely won't make much sense.
    >
    > You might want to think again about the differences between raster and
    > vector graphics. They contain totally different content. Creating a
    > vector
    > graphic (".svg") that contains a small texture taken from a raster
    > graphic
    > (".png") might technically be possible. Where what for ? You will not be
    > able to use it like a real vertor graphic, since you cannot scale it,
    > which
    > is the main point for using vector graphics.
    >


    i remember from really long ago, 20 years or so, there used to be one of
    the early corel draw versions (under windows) that was able to scan pixel
    graphics into vector format, more or less accurately, depending on the
    graphic, of course.

    i haven't needed this since and don't know if this functionality is
    available with any of the svg graphics applications, like inkscape, per
    example. wouldn't surprise me though. not a dedicated application for that
    purpose probably, but if the (hypothetical) app. allows for scripting, you
    might be able to go through your .png files pretty quickly.

    in any case, this is error-prone and would probably make it necessary to
    edit the resulting svg files after their "conversion."

    --
    phani.

  5. #5
    Join Date
    Jun 2008
    Location
    Florida, USA
    Posts
    970

    Default Re: Convert PNG to SVG files

    It would appear what you are looking for is a raster graphics to vector graphics conversion.
    A quick Google search finds that COREL still exists for Winx, big $s.
    A Linux application, potrace, is available in SuSE repo and may do what you want, but not clear if it can do it in batch mode.
    Good luck, let us know if it works for you.

  6. #6
    Join Date
    Jun 2008
    Location
    West Yorkshire, UK
    Posts
    3,432

    Default Re: Convert PNG to SVG files

    A lot depends on the number of colours but I have successfully converted several bitmap images into SVG using Inkscape. You have to select the number of scans which gives you a stack of different coloured layers on top of the original. You need to get rid of the original bitmap image and avoid getting rid of the 'background' layer.

    Assume that you need to have several goes, altering the number of scans, until you get the result you want but it certainly works, very easily with, for example, logos which have only a few colours.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •