Inkscape.org
Beginners' Questions Command Line Batch Conversion
  1. #1
    Lanky_Nibs Lanky_Nibs @Lanky_Nibs

    New user here. I've managed to get the command line going by running inkscape --shell. I am stumped at my next step however. I want to convert a folder filled with svgs to pngs. Would this be the way to do this?

    inkscape -f C:\folder\folder\*.svg -e C:\folder\folder\*.png

    Thanks so much for your help. 

    Lanky

  2. #2
    inklinea inklinea @inklinea⛰️

    There is an Inkscape batch convert for Windows at https://inkscape.org/~Johannski/%E2%98%85inkscape-batch-convert-svgpdfepsemfwmf-to-epspdfpngsvg

    If you scroll right to the bottom and choose the download button ( the arrow icon pointing downwards )

    Make a folder called for example 'svg'

    make a folder in 'svg' called 'out'

    Drop the script _InkscapeBatchConvert.bat and copies of you svgs into the 'svg' folder

    run _InkscapeBatchConvert.bat - will ask 3 questions, input format - output format and dpi

    If you use it in any random folder, it seems to descend into those folders looking for svg :)

    So make sure you use it in a standalone folder

     

  3. #3
    inklinea inklinea @inklinea⛰️
    *

    Possibly an easier method, if you are happy for the files to land in the same folder as the SVG.

    inkscape --export-dpi=300 --export-type=png *.svg

     

  4. #4
    Lanky_Nibs Lanky_Nibs @Lanky_Nibs

    Thank you guys so much! 

  5. #5
    Lanky_Nibs Lanky_Nibs @Lanky_Nibs

    I got the batch file converter running finally. The problem now is it stops between every conversion to pop up a "tiff bitmap image import" dialogue asking about type, dpi, image rendering mode, etc. It offers the option to "Don't ask again" but always does. 

    Is there a workaround to the dialog box?

     

    Thanks again.

  6. #6
    inklinea inklinea @inklinea⛰️

    I think the converter was written before

    Certain features where available in inkscape.

    Can you try this ?

    inkscape --actions="export-dpi:300;export-type:png;export-do;" *.svg


    Adjust the dpi to whatever you want.

    It will make the png in the same folder as the svg 

    But is fairly fast

  7. #7
    Lanky_Nibs Lanky_Nibs @Lanky_Nibs

    I will try this. Thank you!