Search code examples
imagemagickanimated-gifimagemagick-convertwebp

How to convert a single animated webp with a transparent background to an animated gif using imagemagick, with disposing of prior frames?


I have an animated WebP with a transparent background (link).

Running magick -dispose previous .\image.webp .\image.gif (or -dispose background) does not dispose of the previous frame, resulting in the following:

flamingo with a gun, gif

What is the correct way to convert an animated WebP to an animated gif, ideally with convert, while keeping the background clear each frame?


Solution

  • Add -coalesce:

    convert -dispose previous -coalesce flamingun.webp flamingun.gif Fixed image