Search code examples
imagemagickimagemagick-convert

Imagemagick reset scene for each frame in an animated gif


I am trying to generate a gif in the command line.

My source image has tiles like this:

source image

When I create a gif with the command convert source.png -crop 80x80 +repage test.gif I get the following result:

unwanted result

In this image each image is drawn on top of the ones before it. So how can we reset the scene on each image draw so each tile in the source image becomes a frame itself?


Solution

  • I think you need to set the "disposition":

    convert -background none cartoon.png -crop 80x80 +repage -delay 80 -set dispose background  result.gif
    

    enter image description here