Page 1 of 1

resize animated gif

Posted: 2007-04-03T04:52:23-07:00
by enginev
Does anyone knows how I can resize an animated gif file without destroy the animation?

Thanks in advanced for your help

Re: resize animated gif

Posted: 2007-04-04T17:28:06-07:00
by anthony
That is next to imposible when the animation contains transparency. It is also difficult if the animation does not contain transparency.

See the existing notes on this in IM examples
http://www.imagemagick.org/Usage/animations/#resize

generally the best trechnique, is to coalesce (de-optimize) the animation, then do though a complete re-optimization sequence. That is NOT just frame optimization, but also color optimization too. IM Examples has frame optimization notes complete, but color optimization still needs a lot more work http://www.imagemagick.org/Usage/anim_opt/

In short... There is no easy solution

Re: resize animated gif

Posted: 2007-04-05T00:36:26-07:00
by enginev
thanks a lot for the help I really apriciated !!
I found a semi solution to do that cheers ;)

Re: resize animated gif

Posted: 2007-04-06T04:02:30-07:00
by anthony
What was your ''Semi-solution''.

Re: resize animated gif

Posted: 2007-06-28T19:08:07-07:00
by anthony
That de-optimizes and resizes the animation, but does not re-optimize the animation afterwards. It is a reasonable general solution.

It will however fail badly for animations with transparencys as the GIF format can not handle semi-transparent pixels that resize creates. IM just defaults to a 50% transparency threshold which appears to be a universal default for image editors.

This is transparency problem, is especially bad for very thin lines with transparency on both sides.

The best idea is to 'flatten' the animation to a solid color background for GIF animation thumbnails. That way you do not loss 'anti-aliasing' of edges in resized images. Flattening can be done either before or afetr the resize. Most GIF animation websites do it this way.

Finally use the -layers 'optimize' to re-add frame optimization to resuce file sizes further (if posible).