Author Topic: Batch File Conversion?  (Read 3266 times)

October 01, 2016, 11:42:32 AM
Read 3266 times

Rayj00

  • Sr. Newbie

  • Offline
  • **

  • 3

So I have a ton of gif files (thousands)  that I would really like to convert to svg format.

Is there a batch capability in Inkscape to do this?

Thanks,

Ray

October 01, 2016, 02:20:01 PM
Reply #1

Rayj00

  • Sr. Newbie

  • Offline
  • **

  • 3
So I tried the following on a single gif file:

Code: [Select]
C:\Program Files\Inkscape> inkscape -f \\LS-VLA70\Misc\Graphics\frog.gif frog.svg

(inkscape.exe:3628): Gtk-WARNING **: Could not find the icon 'object-visible'. The 'hicolor' theme was not found either, perhaps you need to install it.
You can get a copy from: http://icon-theme.freedesktop.org/releases
** (inkscape.exe:3628): WARNING **: Can't open file: frog.svg (doesn't exist)
^C
C:\Program Files\Inkscape>

Note the ^C.  The above command did not exit so I had to "control-C"  to get back to command line.

Anyway I went to the http://icon-theme.freedesktop.org/releases location and found these:

Index of /releases
[ICO]   Name   Last modified   Size   Description
[PARENTDIR]   Parent Directory       -    
[ ]   default-icon-theme-0.1.tar.gz   2005-02-02 12:52    1.4K   
[ ]   hicolor-icon-theme-0.2.tar.gz   2005-02-02 12:52    1.5K   
[ ]   hicolor-icon-theme-0.3.tar.gz   2005-02-02 12:52    2.2K   
[ ]   hicolor-icon-theme-0.4.tar.gz   2005-02-02 12:52    24K   
[ ]   hicolor-icon-theme-0.5.tar.gz   2005-02-02 12:52    31K   
[ ]   hicolor-icon-theme-0.6.tar.gz   2005-02-02 12:52    31K   
[ ]   hicolor-icon-theme-0.7.tar.gz   2005-02-04 09:17    31K   
[ ]   hicolor-icon-theme-0.8.tar.gz   2005-04-08 08:06    31K   
[ ]   hicolor-icon-theme-0.9.tar.gz   2006-01-12 15:18    32K   
[ ]   hicolor-icon-theme-0.10.tar.gz   2006-11-22 12:02    33K   
[ ]   hicolor-icon-theme-0.11.tar.gz   2009-09-25 13:57    37K   
[ ]   hicolor-icon-theme-0.12.tar.gz   2010-01-13 10:20    37K   
[ ]   hicolor-icon-theme-0.13.tar.gz   2013-12-17 12:16    40K   
[ ]   hicolor-icon-theme-0.14.tar.xz   2014-12-09 12:48    50K   
[ ]   hicolor-icon-theme-0.15.tar.xz   2015-03-24 10:37    50K   
Apache/2.4.10 (Debian) Server at icon-theme.freedesktop.org Port 443

Notice the last two that are dated 2014 and 2015?   The extension seems to be incorrect? I changed the 2015 one to .gz and then I was able to unarc the file with 7zip.
However the unarc'ed contents  looks to be linux based.  I am running windows 7?


Another thing to note is after I executed the command, a "gif bitmap image import"  window popped open requesting some image information (DPI, rendering mode).
Once I clicked ok,  the inkscape gui opened with the gif file displayed along with an error that the file frog.svg cannot be found?

I was expecting everything to take place in the background?  That's what batch jobs are supposed to do?

So one question is:  Is this "hicolor theme" required for Windows?

Ideas?

Ray





October 02, 2016, 12:24:31 AM
Reply #2

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Welcome to Inkscape Community!

I don't think Inkscape is capable of converting GIFs to SVG.  Inkscape can only import GIFs (as well as other raster formats), but not open them or convert to SVG.  When imported, they remain as GIF within the SVG file.

As far as I know, the only way to change the Inkscape theme on Windows, is to change the theme for the whole Windows system.  (change the GTK theme, if you want to try).  It is possible to change the Inkscape theme on Linux, but not on Windows.  (not sure about Macs)

I can't quite decipher the info you have provided, because I don't know how to use the command line.  But perhaps the reason why the high color theme was mentioned in the output, when you asked Inskcape to convert the GIF, was Inkscape's erroneous attempt to do something it's not capable of.  Just guessing though.....

A long time ago, I heard about a graphics program called IrfanView.  It was said to be capable of batch converting a wide variety of formats, to a wide variety of other formats.  I don't know if that's still correct or not.  Or you could also try GIMP, which is a raster graphics editor that provides some very basic vector features.  So possibly it could do the conversion, but I don't know for sure.  Also not sure if it can do batch conversions.

If I could ask what your ultimate goal is, we might be able to suggest other ways to reach it.


  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

October 02, 2016, 08:47:35 AM
Reply #3

Rayj00

  • Sr. Newbie

  • Offline
  • **

  • 3
My goal is to create SVG's from a ton of gifs I have.  I will use these svg's in another program.

I will try irfanview to convert gif's to png's, then use potrace to convert png to svg.

October 02, 2016, 11:15:24 AM
Reply #4

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
That would be an extra and unnecessary step.  I didn't realize you had tracing in mind.  If you want to use Trace Bitmap (or Po Trace), you can import the GIF directly, without converting to PNG first.

However, Trace Bitmap (or Po Trace) is not meant to accurately (much less precisely) reproduce just any kind of raster image to vector.   So I would suggest tracing one of the most complex images first, so you can see what happens.  (Especially you may notice the colors are not true.)

For example, tracing something like your vacation photos, or family portait photos, (or anything with gradients) you will see visible differences.  The more complex the image is, the lower the accuracy of the result.  You can increase the accuracy of the result by increasing the number of scans (in a multiple scan option).  But there still may be a limilt to what you can achieve.

Another problem you might have, is how to configure Trace Bitmap or Potrace.  It seems like doing a batch process, you'd have to use the same configuration of the trace, for each image.  However, as I said, some GIFs may need more scans than others.  So I'm not sure how that problem could be addressed.  But maybe your GIFs aren't very complex?

Also you'll want to keep in mind that the more complex the image is, the longer it will take Inkscape to perform the trace.  So setting up some kind of batch process could take hours to finish, potentially.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann