Search code examples
imagemagickanimated-gif

How do remove the flickering in this ImageMagick produced animation. Ive tried exactly as documented


How do I remove the flickering in this ImageMagick produced animation. Ive tried exactly as documented.

magick.exe  -dispose none -delay 0  ./temp/0000.png  -dispose previous -delay 9 ./temp/$($prefixName)*  -loop 0 ./output/$($prefixName).gif
  • The first image is an empty transparent image
  • The next following images are several images for the animation
  • I did exactly as documented, even with -delay 0, I can see the flicker
  • IM version is 7.1.1-11, platform is Windows 11, code run in Powershell script
  • There's a visible flicker of the blank image

flickering animation


Solution

  • The flicker is your empty frame 0000.png. There is no "instant" frame replacement in a Gif (in other words your -delay 0 is replaced by the smallest allowed delay), so your empty image is visible for a short while.

    But specifying that initial frame appears unnecessary, you can generate your animation with

    magick.exe  -dispose previous -delay 9 ./temp/$($prefixName)*  -loop 0 ./output/$($prefixName).gif
    

    and IM does the right thing with the first frame:

    enter image description here