Mobile app version of vmapp.org
Login or Join
Frith110

: How to automatically export multiple assets at multiple resolutions from a single SVG file with Inkscape? Thanks for your comments. I realize my initial wording might have been confusing, so I

@Frith110

Posted in: #Export #Inkscape #Png #Svg #Vector

Thanks for your comments. I realize my initial wording might have been confusing, so I have attempted to clarify what I'm looking for...



I use Inkscape for designing and exporting app assets. These assets are created a 4x scale (which corresponds to xxxhdpi on Android or @4xon iOS). Let's assume I have several vector icons that are 256x256 pixels within a single SVG opened in Inkscape. I need to export each of these icons at the following resolutions:


22.50 dpi (mdpi for Android) -> 64x64 pixels
33.75 dpi (hdpi for Android) -> 96x96 pixels
45.00 dpi (xhdpi for Android, @2x for iOS) -> 128x128pixels
67.50 dpi (xxhdpi for Android, @3x for iOS) -> 192x192 pixels


Doing this manually is really tedious. My question is thus: Is there an efficient way to export one or several specific objects within an SVG file at multiple resolutions from within Inkscape?

Note: I have hacked together a working, scripted solution that invokes svg-objects-export multiple times, but it is very slow and inconvenient, because I need to adapt the script every time I add an asset to the SVG file.

Ideally, I'm looking for a solution from within Inkscape ("Click and export", possibly for multiple selected objects at once). If that's not possible I'll take the next best option. A command line solution would be fine, as long as it's fast and automatically exports all assets in a file.

For quality reasons, I am also not looking for a solution to scale down exported PNGs.

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Frith110

3 Comments

Sorted by latest first Latest Oldest Best

 

@Yeniel278

Create clones of your icons for each of the addition sizes you want to export. Give them ID:s in Object Properties and use the batch export option to save all of them in one click.

10% popularity Vote Up Vote Down


 

@Vandalay110

Maybe try any of these extensions (didn't test them):
inkscape.org/en/~owenfromcanada/%E2%98%85androidvector (different concept, exports vectors for Android)
github.com/ChristianBecker/inkscape-android-export (what you've been asking for)

(a web search may find a couple more of those, key words 'extension Inkscape android')

10% popularity Vote Up Vote Down


 

@Debbie163

Check out this tool github.com/redwarp/9-patch-resizer It will automatically resize .png files into several densities.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme