Automating app assets with Inkscape
insertbreakpoint.wordpress.com
insertbreakpoint.wordpress.com
See https://github.com/fogleman/primitive for working SVG-as-triangles generation from bitmaps (or higher resolution/complexity SVG input).
Wow! I run a similar automated set up (for a game), with the flow being: Photoshop layer gets edited -> PNG gets exported -> PNG gets post-processed in Node -> all PNGs get stitched into a texture map, and even with ~100 images it runs in a few hundred milliseconds.
Unless InkScape does special SVG stuff I don't know about, I suspect that using something like ImageMagick, or even some random svg2png.js/py script, would make this instant - and thus something you can just add to your build process, rather than worrying about triggering it only when the source files have changed.
That said, I can't imagine even a moderate batch conversion/export job only taking a few hundred milliseconds unless it's somehow barely doing any work, or the total file size of all exports/renders is pretty small.
Suggestions - perhaps you could script with another language rather than using a .bat? For example you could use Python to create the commands. With that you might also be able some simple looping instead of successive commands, which would make future changes easier (not that you can't do this with a batch file also, but personally every time I've tried to do anything similar with batch files I've ended up losing the will to live..).
Personally I used it to combine generating mail merged print and laser cut patterns for the place cards. So you get a pdf to print out and a laser cutting SVG which can be 'lasered on' after the printing.
If there was an easy cross-platform scripting language that was installed by default, now we'd be talking.
Or, you know, write Powershell (depending on what platforms you need to support ofc).
I definitely don't see using cs files or f# scripts as an easier way of doing this.
That said, there's a LOT of repetition in there and while you probably _can_ improve that in this solution, a 'proper' language might be more readable. Again, if you're a C# developer, C#/F# (or even Powershell) scripts are probably ~closer to home~.
That whole script is basically - if I understand it correctly - two unrolled loops. Instead of two loops (logo dimensions, scale) you're duplicating a loooot of lines.
If this is no problem: Cool. Then again, maybe you want to improve this approach in the future?
https://marketplace.visualstudio.com/items?itemName=PeterR.U... https://github.com/shenchauhan/UWPTileGenerator