Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Currently I do this in a BAT file:

Inkscape.exe --file "some.svg" --export-png "some_64.png" --export-width 64
Inkscape.exe --file "some.svg" --export-png "some_96.png" --export-width 96
Inkscape.exe --file "some.svg" --export-png "some_128.png" --export-width 128

But that is kind of slow to run Inkscape 3 times in a row and open the same file, plus you have to save the source svg file prior to running the export BAT and make sure the BAT gets the right filename.

So I'm wondering if there is a tool (or plugin) that allows programmatic, or batch, export from Inkscape, something like Export Bitmap dialog, but with scripting support?

share|improve this question

migrated from gamedev.stackexchange.com Jun 10 '11 at 21:18

This question came from our site for professional and independent game developers.

    
I would use Gimp to do the export, as you can batch exports and easily use scripts to change what you need. I created my own batcher the other day for my question : gamedev.stackexchange.com/questions/12997/…. I can help you out with that if you want. –  3nixios Jun 10 '11 at 10:29

1 Answer 1

An alternative would be to create a rectangle for each export size you want, and put each of them in a separate layer (e.g. named as the export size - size64, size96 etc.).

The trick is that when you select one of those rectangles, and hit export, that object will remember the export properties, e.g. the size of the exported bitmap, aswell as the path. Be sure to stay in the "Selection" tab of the export bitmap dialog.

Make all rectangle layers fully transparent. Note that it is still possible to select such a rectangle both by left-clicking and Ctrl+A:ing if the layer it is in is the active layer.

Once you have defined these export targets/rectangles, you can re-export them once again by selecting[1] all the export rectangles and hitting Ctrl+Shift+E again to get the export dialog. Hit the checkbox "Batch export X objects" and hit Export!

Now to make this process economic, you might want to define a whole array of rectangles for all your graphics, so you have one rectangle for each graphic, in each non-graphic layer.

[1] selecting all export rectangles requires a little trick: in layer dialog lock all non-export-rectangle-layers and then hit Ctrl+A. Voila - all transparent export rectangles selected!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.