Advertisement
melior

Spritesheet2AnimatedGIF.sh

Jun 6th, 2012
392
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.43 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Check number of inputs
  4. if [ $# -ne 2 ]; then
  5.     echo "Needs two input arguments"
  6.     exit 0
  7. fi
  8.  
  9. # Split into 64-pixel-wide strips (base sprites are animated left-to-right)
  10. convert "$1" -crop 64 +repage zzztmp.png
  11. # Remove the first frame (each base sprite has a standing frame first)
  12. rm zzztmp-0.png
  13. # Animate
  14. convert -delay 10 -loop 0 -dispose background zzztmp-*.png "$2"
  15. # Remove temporary files
  16. rm zzztmp-*.png
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement