Skip to content

Instantly share code, notes, and snippets.

@AKiniyalocts
Last active October 16, 2018 18:03
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save AKiniyalocts/90025dde8d5667b09f68 to your computer and use it in GitHub Desktop.
Save AKiniyalocts/90025dde8d5667b09f68 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