'How to avoid Imagemagick's convert overlay of frames in a gif

I have a bunch of files labelled 1.png and so on. I'm using the following command line to produce a gif animation:

convert -delay 20 *.png animation.gif

But the frames get superposed sequentially. I did not expect this behavior, what might be wrong?

Thanks



Solution 1:[1]

Option -dispose previous:

convert -dispose previous -delay 20 *.png animation.gif

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Stéphane Laurent