Page 1 of 1

Most efficient way to crop/resize animated gif

Posted: 2010-10-28T08:02:32-07:00
by Somebi
For example doing this:

/usr/bin/convert test.gif -coalesce -resize 200x200 test.gif

with this animated gif http://glitters.ru/images/butterfly_20008.gif (3 frames), took me roughly 1min and 9 seconds. It's a bit too much...

I was trying to do this on VDS with 800mhz and 256 ram.

Is there any efficient solution? Or i should stop searching, because there is not?

Re: Most efficient way to crop/resize animated gif

Posted: 2010-10-28T10:28:56-07:00
by fmw42
I am not a real expert on animations, but as far as I know what you have done is all you can do besides adding optimization, which is not a speed issue but a file size issue.

see
http://www.imagemagick.org/Usage/anim_basics/
http://www.imagemagick.org/Usage/anim_opt/
http://www.imagemagick.org/Usage/anim_mods/

You could do

convert anim.gif -resize ... newanim.gif

but that only works if each frame of the animation is a full frame and not an update. That is why you need -coalesce to be sure.

Re: Most efficient way to crop/resize animated gif

Posted: 2010-10-28T18:20:29-07:00
by anthony
That animation has a LOT of very low level pixel patterns. Any form of resize is not going to work well. It will either result in large pixels, or a uniform less glittery output.

The best idea is to try and extract the original static image, and its glitter mask, resize those and then re-add the glitter to re-create the animation at the new size.