Page 1 of 1

Problem with dispose previous for animated GIFs

Posted: 2009-07-19T23:51:42-07:00
by grossmesiter
Hi everybody,
I'm trying to reproduce this example:
http://www.imagemagick.org/Usage/anim_basics/#previous

Code: Select all

convert -dispose none  -delay 0 \
-size 100x100 xc:SkyBlue +antialias \
-fill DodgerBlue -draw 'circle 50,50 15,25' \
-dispose previous -delay 100 \
-page +5+10  balloon.gif  \
-page +35+30 medical.gif  \
-page +62+50 present.gif  \
-page +10+55 shading.gif  \
-loop 0  canvas_prev.gif
But the same code as there make wrong image on my IM 6.5.4-3
Here it is:
http://dev.artcactus.com/effects/effect ... s_prev.gif

It seems that all -dispose methods (none,previous,Background) return same result.

Is that example already outdated or I'm doing something wrong?

Re: Problem with dispose previous for animated GIFs

Posted: 2009-07-20T00:16:07-07:00
by grossmesiter
I've downgraded IM version to 6.5.1-9 (that was used for generating examples) and got correct result.
So, it is probably bug in the newest versions of IM.

Re: Problem with dispose previous for animated GIFs

Posted: 2009-07-20T19:19:45-07:00
by anthony
Report it as a bug.
Look like the first images disposes was changed from 'none' to 'previous', that is BAD!

You can also set the disposal method for images already in memory using
-set dispose {...}

However that will set it to all images in memory, whcih is why it isn't quite as nice as setting it on image creation. Ditto for delay, and for page, and so on.

Code: Select all

convert-size 100x100 xc:SkyBlue +antialias \
-fill DodgerBlue -draw 'circle 50,50 15,25' \
-page +5+10  balloon.gif  \
-page +35+30 medical.gif  \
-page +62+50 present.gif  \
-page +10+55 shading.gif  \
-set dispose previous -set delay 100 \
\( -clone 0 -set dispose none -set delay 0 \) -swap 0 +delete \
-loop 0  canvas_prev.gif
the third last line sets disposal and delay for ALL images,
the second last resets the first (zeroth) images dispose and delay

You can also try...

Code: Select all

convert  -size 100x100 xc:SkyBlue +antialias \
-fill DodgerBlue -draw 'circle 50,50 15,25' \
-set delay 0 -set dispose none \
\( -page +5+10  balloon.gif  \
   -page +35+30 medical.gif  \
   -page +62+50 present.gif  \
   -page +10+55 shading.gif  \
   -set dispose previous -set delay 100 \
\) -loop 0  canvas_prev.gif
See parenthesis in Basics, Image Sequences
http://www.imagemagick.org/Usage/basics/#image_seq