Resizing animated GIFs with ImageMagick

After an intense search on the web with no really satisfying result, I
finally found a way to resize animated gifs with ImageMagick. The
problem was, the image looked weird if just resized via

convert -size 200x100 big.gif -resize 200x10 small.gif

What I had to do is to coalesce the image prior to resizing. This
fills all frames and converts the animated gif in a movie-like
condition, wich allows easily to process it

convert big.gif -coalesce coalesce.gif

then

convert -size 200x100 coalesce.gif -resize 200x10 small.gif

Voila!_This_is_for_all_you_folks_out_there_looking_for_a_way_to_resize
animated_gifs!

more very helpful information on
http://www.cit.gu.edu.au/~anthony/graphics/imagick6/

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
  1. Nov 08, 2008

    Anonymous says:

    So I did this. My source file, a 271 kb 170x170 gif ends up weighing 420 kb afte...

    So I did this. My source file, a 271 kb 170x170 gif ends up weighing 420 kb after I resize it to 120x120. Why is this and is there a way to avoid it?

    1. Jan 03, 2009

      Anonymous says:

      That's due to the coalesce. You will have to not use this method of resizing if...

      That's due to the coalesce. You will have to not use this method of resizing if file size is important.

  2. Mar 03, 2009

    Anonymous says:

    Hi, how to put -coalesce in batch? I have folder with animated gif images, and ...

    Hi,

    how to put -coalesce in batch? I have folder with animated gif images, and I want to apply coalesce before I resize them. Thx

  3. May 12, 2009

    Anonymous says:

    How Optimize Gif: http://www.imagemagick.org/Usage/anim_opt/