Skip to content

Instantly share code, notes, and snippets.

@susthitsoft
Forked from AKiniyalocts/generate_icons.sh
Created October 16, 2018 18:03
Show Gist options
  • Save susthitsoft/8d318ecb6511ee6c07bfb81b7b8b9ca0 to your computer and use it in GitHub Desktop.
Save susthitsoft/8d318ecb6511ee6c07bfb81b7b8b9ca0 to your computer and use it in GitHub Desktop.
Generate resized icons for your android applications using imagemagick!
#!/bin/bash
# This requires imagemagick (a super awesome image tool)
# Install via: sudo apt-get install imagemagick
echo "Enter the path to the 512x512 icon"
read icon
mkdir "drawable-mdpi" "drawable-hdpi" "drawable-xhdpi" "drawable-xxhdpi" "drawable-xxxhdpi"
IC_LAUNCHER='ic_launcher.png'
convert $icon -resize 192x192 drawable-xxxhdpi/$IC_LAUNCHER
convert $icon -resize 144x144 drawable-xxhdpi/$IC_LAUNCHER
convert $icon -resize 96x96 drawable-xhdpi/$IC_LAUNCHER
convert $icon -resize 72x72 drawable-hdpi/$IC_LAUNCHER
convert $icon -resize 48x48 drawable-mdpi/$IC_LAUNCHER
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment