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?
Most efficient way to crop/resize animated gif
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Most efficient way to crop/resize animated gif
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.
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.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Most efficient way to crop/resize animated gif
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.
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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/