Advertisement
Guest User

Untitled

a guest
Nov 8th, 2015
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Usage
  4. # -------------------------------------------
  5. usage() { echo "usage: $0 src_image bg_color [dst_dir]"; exit 1; }
  6. [ "$1" ] && [ "$2" ] || usage
  7. [ "$3" ] || set "$1" "$2" "./images"
  8.  
  9.  
  10. # Directories
  11. # -------------------------------------------
  12. ICONDIR=$3/icon
  13. SCREENDIR=$3/screen
  14. eval mkdir -p "$ICONDIR"
  15. eval mkdir -p "$SCREENDIR"
  16.  
  17.  
  18. # Show progress
  19. # -------------------------------------------
  20. set -x
  21.  
  22.  
  23. # App Icons
  24. # -------------------------------------------
  25. c="convert -background none"
  26.  
  27. # iPhone iOS 5/6
  28. $c "$1" -resize 57x57 "$ICONDIR/Icon.png"
  29. $c "$1" -resize 114x114 "$ICONDIR/Icon@2x.png"
  30. # iPad iOS 5/6
  31. $c "$1" -resize 72x72 "$ICONDIR/Icon-72.png"
  32. $c "$1" -resize 144x144 "$ICONDIR/Icon-72@2x.png"
  33. # iPhone iOS7
  34. $c "$1" -resize 60x60 "$ICONDIR/Icon-60.png"
  35. $c "$1" -resize 120x120 "$ICONDIR/Icon-60@2x.png"
  36. # iPad iOS7
  37. $c "$1" -resize 76x76 "$ICONDIR/Icon-76.png"
  38. $c "$1" -resize 152x152 "$ICONDIR/Icon-76@2x.png"
  39. # Setting
  40. $c "$1" -resize 29x29 "$ICONDIR/Icon-Small.png"
  41. $c "$1" -resize 58x58 "$ICONDIR/Icon-Small@2x.png"
  42. # Spotlight
  43. $c "$1" -resize 40x40 "$ICONDIR/Icon-Small-40.png"
  44. $c "$1" -resize 80x80 "$ICONDIR/Icon-Small-40@2x.png"
  45. $c "$1" -resize 50x50 "$ICONDIR/Icon-Small-50.png"
  46. $c "$1" -resize 100x100 "$ICONDIR/Icon-Small-50@2x.png"
  47.  
  48. # AppStore
  49. $c "$1" -resize 512x512 "$ICONDIR/iTunesArtwork.png"
  50. $c "$1" -resize 1024x1024 "$ICONDIR/iTunesArtwork@2x.png"
  51.  
  52.  
  53. # App Launch Images
  54. # -------------------------------------------
  55. c="convert $1 -background $2 -gravity center"
  56.  
  57. # iPhone
  58. $c -resize 256x256 -extent 320x480 "$SCREENDIR/Default~iphone.png"
  59. $c -resize 512x512 -extent 640x960 "$SCREENDIR/Default@2x~iphone.png"
  60. $c -resize 512x512 -extent 640x1136 "$SCREENDIR/Default-568h@2x~iphone.png"
  61. # iPad
  62. $c -resize 512x512 -extent 768x1024 "$SCREENDIR/Default-Portrait~ipad.png"
  63. $c -resize 1024x1024 -extent 1536x2048 "$SCREENDIR/Default-Portrait@2x~ipad.png"
  64. $c -resize 512x512 -extent 1024x768 "$SCREENDIR/Default-Landscape~ipad.png"
  65. $c -resize 1024x1024 -extent 2048x1536 "$SCREENDIR/Default-Landscape@2x~ipad.png"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement