Reputation: 86572
I have drawn an icon in Inkscape, but would now like to programmatically alter it (change the colours slightly for different icon states) and convert it to a tiled PNG format file containing multiple icons with different colours. I know about Inkscape's --export-png options, but can't see a way to make it change the image and/or export multiple times to different parts of the combined image.
Are there any good user-oriented tools for programmatically fiddling with images, or do I have to delve into GD or even manually modifying the SVG XML?
Upvotes: 2
Views: 761
Reputation: 1517
I use two simple sets of tools to do this for a webcomic:
Note: Inkscape can be installed on a webserver with a bit of work and can be called from a CGI (perl, php, etc.), though it's slow (so you should cache the results).
Calling it from the command line on a directory of SVG files:
find -name "*svg" -exec inkscape -z --file={} \
--export-png=$OUTPUT{}.png --export-width=640 --vacuum-defs \;
You may also be interested in Batik, an SVG render engine written in Java. It runs nicely on the server side, and is fairly self-contained.
Upvotes: 0
Reputation: 2207
Even though I'm not 100% sure if it fulfills your request for user-orientation, I recommend you to have a look at www.imagemagick.org. I have successfully used its "convert" utility for scripting conversion from svg to png and also for adding custom background colors.
Upvotes: 3