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. Jun 27, 2007

    Anonymous says:

    Thank you so much. It works fine

    Thank you so much. It works fine

  2. Oct 17, 2007

    Anonymous says:

    thanks

    thanks

  3. Jan 12, 2008

    Anonymous says:

    Thanks dude. Worx like a charm.

    Thanks dude. Worx like a charm.

  4. Feb 05, 2008

    Anonymous says:

    This works ok too convert sourcefile -coalesce -resize XXxYY -deconstruct destf...

    This works ok too

    convert sourcefile -coalesce -resize XXxYY -deconstruct destfile

  5. Mar 04, 2008

    Anonymous says:

    You are a gentleman and a scholar! Thanks!

    You are a gentleman and a scholar! Thanks!

  6. Aug 04, 2008

    Anonymous says:

    Thank you. It works very well.

    Thank you. It works very well.

  7. 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.

  8. Mar 03

    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

  9. May 12

    Anonymous says:

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

Add Comment


These projects are supported by Liip AG