Problem with dispose previous for animated GIFs

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
grossmesiter

Problem with dispose previous for animated GIFs

Post 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?
grossmesiter

Re: Problem with dispose previous for animated GIFs

Post 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.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Problem with dispose previous for animated GIFs

Post 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
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply