Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Takes a 1024x1024 app icon and produces all app icon sizes based on it.
- # Requires imagemagick to work.
- # USAGE iair ORIGINAL_FILE PATH_TO_OUTPUT_DIR
- # Example: iair icon.png .
- original_file=$1
- output_dir=$2
- if [ ! -f $original_file ]; then
- echo 'File $original_file not found'
- exit
- fi
- #Array of all required sizes
- declare -a sizes=("16"
- "29"
- "32"
- "40"
- "48"
- "50"
- "55"
- "57"
- "58"
- "64"
- "72"
- "76"
- "80"
- "87"
- "88"
- "100"
- "114"
- "120"
- "128"
- "144"
- "152"
- "167"
- "172"
- "180"
- "196"
- "256"
- "512"
- "1024")
- for size in ${sizes[@]}
- do
- convert $original_file -resize $size'x'$size "$output_dir/Icon-$size.png"
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement