Sample Header Ad - 728x90

How can I create the launcher icons via console?

1 vote
0 answers
208 views
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](https://developer.android.com/studio/write/create-app-icons#access) , 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](https://stackoverflow.com/q/74330586/562769)
Asked by Martin Thoma (353 rep)
Feb 29, 2024, 12:13 PM