How can I automate GIF to PNG with Preview using AppleScript?
You could also try using ImageMagick:

convert -coalesce animation.gif frame%04d.png


You can install ImageMagick with brew install imagemagick or sudo port install imagemagick.