Inkscape.org
Using Inkscape with Other Programs Export multiple objects to multiple PNG files with one command line
  1. #1
    Edaqa Mortoray Edaqa Mortoray @mortoray

    I use `--export-filename`, along with `--export-id`and more, to export an object to a PNG file. I call this multiple times for several objects in the same file. Is it possible to have one invocation of inkscape execute multiple commands, to export more than one object at a time?

     

  2. #2
    Yaqiyn Yaqiyn @Yaqiyn

    I'm trying to figure out how to export multiple objects in PNG format at one time as well. I really am so confused with all of it. I need to export over 1,200 objects! Like who has time to export that many objects one by one?? 

    I tried using an extension called inx-exportobjects v0.2  that I found on the following form: https://graphicdesign.stackexchange.com/questions/51592/save-multiple-objects-from-vector-file-to-separate-files-using-inkscape-os-freew

    but the last step keep giving me some error code... I think. It's in the image attached 

    I selected 60 objects to try and export.

    Any help is greatly appreciated!

    Thank you

    Screenshot (7)
  3. #3
    inklinea inklinea @inklinea⛰️

    mortoray which operating system are you using, windows, linux ( I dont have access to a mac ) 

  4. #4
    berteh berteh @berteh
    *


    svg-objects-export works for me, exporting based on ID or Label (opt. with regular expressions), or XPATH predicates:
    https://github.com/berteh/svg-objects-export

    I use it to export sprites, cards games, or the same objects at different resolutions...and I'd gladly integrate your improvements to this very simple script if you make any (via github).

  5. #5
    Jurgen Gaeremyn Jurgen Gaeremyn @JurgenG
    berteh

    svg-objects-export works for me, exporting based on ID or Label (opt. with regular expressions), or XPATH predicates: https://github.com/berteh/svg-objects-export I use it to export sprites, cards games, or the same objects at different resolutions...and I'd gladly integrate your improvements to this very simple script if you make any (via github).

    Are you using a new version of Inkscape for this? It appears this extension is 9 years old, and is made for Python2 (which is no longer supported in recent versions of Inkscape).

  6. #6
    Jurgen Gaeremyn Jurgen Gaeremyn @JurgenG

    If you're using Linux, I would suggest writing a little bash script of integrated command. This would be the command:

    cat file.txt | while read in; do inkscape --export-filename $in.png --export-id $in; done

    For reference: I got my musterd here: https://stackoverflow.com/questions/13939038/how-do-you-run-a-command-for-each-line-of-a-file

Inkscape Inkscape.org Inkscape Forum Using Inkscape with Other Programs Export multiple objects to multiple PNG files with one command line