Advertisement
Guest User

Untitled

a guest
Apr 30th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Takes a 1024x1024 app icon and produces all app icon sizes based on it.
  4. # Requires imagemagick to work.
  5. # USAGE iair ORIGINAL_FILE PATH_TO_OUTPUT_DIR
  6. # Example: iair icon.png .
  7.  
  8. original_file=$1
  9. output_dir=$2
  10.  
  11. if [ ! -f $original_file ]; then
  12. echo 'File $original_file not found'
  13. exit
  14. fi
  15.  
  16. #Array of all required sizes
  17. declare -a sizes=("16"
  18. "29"
  19. "32"
  20. "40"
  21. "48"
  22. "50"
  23. "55"
  24. "57"
  25. "58"
  26. "64"
  27. "72"
  28. "76"
  29. "80"
  30. "87"
  31. "88"
  32. "100"
  33. "114"
  34. "120"
  35. "128"
  36. "144"
  37. "152"
  38. "167"
  39. "172"
  40. "180"
  41. "196"
  42. "256"
  43. "512"
  44. "1024")
  45.  
  46. for size in ${sizes[@]}
  47. do
  48. convert $original_file -resize $size'x'$size "$output_dir/Icon-$size.png"
  49. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement