Don't like ads? PRO users don't see any ads ;-)
Guest

Spritesheet2AnimatedGIF.sh

By: melior on Jun 6th, 2012  |  syntax: Bash  |  size: 0.43 KB  |  hits: 50  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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