0

I want to automate the branding of a white-label Android app. One thing that requires manual work is taking a 512x512 px PNG image and creating the launcher icons:

├── ic_launcher-playstore.png
└── icons
    ├── mipmap-hdpi
    │   ├── ic_launcher_foreground.png
    │   ├── ic_launcher.png
    │   └── ic_launcher_round.png
    ├── mipmap-mdpi
    │   ├── ic_launcher_foreground.png
    │   ├── ic_launcher.png
    │   └── ic_launcher_round.png
    ├── mipmap-xhdpi
    │   ├── ic_launcher_foreground.png
    │   ├── ic_launcher.png
    │   └── ic_launcher_round.png
    ├── mipmap-xxhdpi
    │   ├── ic_launcher_foreground.png
    │   ├── ic_launcher.png
    │   └── ic_launcher_round.png
    └── mipmap-xxxhdpi
        ├── ic_launcher_foreground.png
        ├── ic_launcher.png
        └── ic_launcher_round.png

I currently do that via Image Asset Studio, but it's monotonic work that seems easy to automate.

Is there a way to generate those images automatically?

What I thought about

  1. Using convert (imagemagick): I'm uncertain how to apply the rounding though.
  2. A Python package: I haven't found anything on pypi
  3. Running Image Asset Studio via command line: seems not to be possible
3
  • That you can not run asset-studio jar file from command-line doesn't mean you can not use it. You just need to develop a small program that uses this library. The source code can be found in AOSP or you just decompile the version you have.
    – Robert
    Commented Feb 29 at 13:08
  • I was hoping that I'm not the first one facing this issue and thus that a finished solution already exists. Also, adjusting the imagemagick-approach seems WAY easier than decompiling Android Studio just for that function (plus the source code is here) Commented Feb 29 at 13:21
  • 1
    Yes, other way may be simpler, but you are wrong on one thing: asset-studio is not part of AS (at least not the JAR file mentioned in the linked SO question). It is part of Android SDK tools. Not sure why it is there (by which command it is required?) and if the GUI of Android Studio of that name bases on the same sources.
    – Robert
    Commented Feb 29 at 14:23

0

You must log in to answer this question.

Browse other questions tagged .