Advertisement
ellisgeek

image spliter

Jun 20th, 2011
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.49 KB | None | 0 0
  1. #!/bin/bash
  2. loc () {
  3.     while true; do
  4.         read -e -p "Please enter the path to the folder that terrain.png is in: " -i "./" $loc;
  5.         strip
  6.     done
  7. }
  8. strip () {
  9.     mkdir $loc/out;
  10.     convert $loc/terrain.png -crop $res  +repage  +adjoin  $loc/out/terrain_%02d.png;
  11.     echo "Done!"
  12.     exit
  13. }
  14. res () {
  15.     echo "Please Select the resolution of this pack?"
  16.     select res in "16x16" "32x32" "64x64" "128x128" "256x256" "exit"; do
  17.         if [ "$res" == "exit" ]
  18.             then exit
  19.             else loc
  20.         fi;
  21.     done
  22. }
  23.  
  24. res
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement