Search code examples
imagemagickpng

How to resize an animated png with ImageMagick?


I want to resize a animated png with ImageMagick. I tried command like this:

convert animation.png -coalesce -resize 500x500 -layers optimize -loop 0 resize.png

However, it only works on GIF but not on apng.


Solution

  • If your Animated PNG is in APNG format, then you would need to do the following in Imagemagick 7. Not sure it works in the older Imagemagick 6.

    magick APNG:animation.png -coalesce -resize 500x500 -layers optimize -loop 0 APNG:new_animation.png
    

    This is untested. I am not sure if -layers optimize works on APNG.