I have a png sprite sheet (8 small frames put in this way: 12345678). I want to convert it to an animated gif and to an animated mng. The sprite sheet is 128x16. I want the frames to be 16x16.
I want to do it by command line, if possible in a single command.
I have tried something like:
convert -crop 16x16 +repage base.png -delay 20 -loop 0 result.gif
but the frames aren't animated "in place" (the animation is showed as: 1......., 12......, 123....., 1234...., 12345..., 123456.., 1234567., 12345678, 1......., where 1...8 are the frames and . is "blank")
Thanks a lot!
Creating an animated gif/mng from a sprite sheet
Re: Creating an animated gif/mng from a sprite sheet
Found.
convert -dispose 3 -delay 20 -loop 0 base.png -crop 16x16 +repage result.gif
the order of the operators was wrong.
convert -dispose 3 -delay 20 -loop 0 base.png -crop 16x16 +repage result.gif
the order of the operators was wrong.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Creating an animated gif/mng from a sprite sheet
-dispose and -delay should come before the input image and -loop should be last before the output
Re: Creating an animated gif/mng from a sprite sheet
Just checked... -loop can go where I put it or between the input file name and the output file name (I have used a -loop 2 to test this)fmw42 wrote:-dispose and -delay should come before the input image and -loop should be last before the output
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Creating an animated gif/mng from a sprite sheet
I am just going by Anthony's recommendations at http://www.imagemagick.org/Usage/anim_basics/#gif_anim
"As such I recommend that you always set "-loop" when creating a GIF animation, after all the images has been read in."
"As such I recommend that you always set "-loop" when creating a GIF animation, after all the images has been read in."