- ImageMagick Examples Preface and Index
- Known and Fixed Bugs Index
The GIF animation operators of IM has been problem area for users for a very
long time. I know I have been wrestling with them since version 4. The
following details the long time problems that existed at the time I myself
fixed the bugs, and expanded the GIF animation operators, available.
Sometimes you just have to fix things yourself. :-)
This page is for reference for older IM users who may still have to deal with
this bug. The examples on this page have not been re-created when/if the bug
Coalesce Bugs -- Fixed IM v6.2.6-1
IM has in general always work fine for animations that only overlays images
onto the results of the last image output. These animations are typically
fully opaque (no transparent pixels) and are generated using either a
" setting of
' or '
However for the other two forms of animation "
" methods, '
' and '
', the "
" function did not work
properly to generate the correct look of the animation at each frame.
The major problem with these methods was that pixels in the next frame
generated could be cleared back to a transparent color, something that just
overlaying the next frame will not achieve. The reslt was that the colesced
animation did not have the same look as the original animation.
For example, here is a '
' disposal animation, which had the worse results for
magick -dispose none -delay 0 \
-size 100x100 xc:skyblue \
-fill dodgerblue -draw 'circle 50,50 15,25' \
-dispose background -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_bgnd.gif
Which for IM version 6.2.2 produced the following "
magick canvas_bgnd.gif -coalesce canvas_bgnd_coalesce_old.gif
montage canvas_bgnd_coalesce_old.gif -tile x1 -geometry '+2+2' \
-background none -bordercolor none canvas_bgnd_coal_old_frames.gif
As you can see the results was incorrect, with the background being cleared
to the background color. In fact any animations involving transparency has
problems such as this.
However from IM version 6.2.6-1, "
" now produces the correct frames, and sets the disposal
methods for the coalesced frames so that the animated form also works exactly
like the original animation.
magick canvas_bgnd.gif -coalesce canvas_bgnd_coalesce.gif
montage canvas_bgnd_coalesce.gif -tile x1 -geometry '+2+2' \
-background none -bordercolor none canvas_bgnd_coal_frames.gif
It has taken a very long incremental testing to reach this point.
Getting the appropriate '
' disposal effects,
and setting the "
" method for the new coalesced animation is not a simple
All these "
problems were fixed in version 6.2.6-1.
Deconstruct Bug - Replacement operator IM v6.2.6-3
Finding any "
" problems is difficult unless "
" doing the right job.
original purpose was to find the differences from one frame to another, and
this is can be done without any need to look at or understand GIF animation
For example, given the above montage of a correctly coalesced '
operator will generate the following frames...
magick canvas_bgnd_coalesce.gif -deconstruct canvas_bgnd_deconst.gif
magick canvas_bgnd_deconst.gif -bordercolor none -frame 4x4+2+2 miff:- |\
montage miff:- -tile x1 -geometry '+2+2' \
-background none -bordercolor none canvas_bgnd_dec_frames.gif
The actual frame images generated by "
" is correct, as
they do show the rectangular area that has changed in the animation.
And in fact using "
" on animations which only overlay the changes from
one frame to the next will work fine for a disposal method of '
However as you can see from the animation of 'Deconstructed' images that were
generated (see right), they do not
work correctly in a GIF animation.
This problem will never be corrected!
This problem was fixed in IM v6.2.6-3, by providing a new "
" method, that not
only deconstructs the image but trys to find the best "
" method to frame
optimize the animation correctly.