animated .gifs and IM

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?".
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: animated .gifs and IM

Post by fmw42 »

you could also coalesce the frames and then shrink them and put them back.

convert image.gif -coalesce -resize WidthxHeight newimage.gif

see

http://www.imagemagick.org/Usage/anim_basics/
http://www.imagemagick.org/Usage/anim_opt/
http://www.imagemagick.org/Usage/anim_mods/
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: animated .gifs and IM

Post by snibgo »

It's strange that IE8 can animate some (eg "test mission rails with inserts") but not others (eg "test sato gates").

I downloaded the small "test sato gates" and tried:

convert sato_gates.gif sg1.gif
convert sato_gates.gif -coalesce sg2.gif

sg1.gif won't animate under IE8, but sg2.gif will. Perhaps IM does a simple copy for sg1, but for sg2 it has to unpack and re-pack.

According to identify -verbose, sato_gates.gif has frames of different sizes (239x168 and 240x155), and they have geometry offsets. sg2.gif doesn't.

Is there a "crop" somewhere in the IM chain without a corresponding "+repage"? Do you really want different frame sizes within an animation?
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: animated .gifs and IM

Post by fmw42 »

without the coalesce, many animations simply have frame updates and are not full frames. that is what coalesce does -- it makes them full frames with the updates included. So perhaps some browsers don't know how to deal with updates that are not properly full framed.

It might also be an issue of optimization or disposal.

see http://www.imagemagick.org/Usage/anim_basics/#dispose

But I am really not an expert on animations.

see coalesce

http://www.imagemagick.org/script/comma ... p#coalesce
http://www.imagemagick.org/Usage/anim_basics/#coalesce
cassy

Re: animated .gifs and IM

Post by cassy »

fmw42 wrote:some browsers won't animate if the delay between frames is too short. Be sure that there is a delay set properly.
delay is set to 3 seconds in all images.
cassy

Re: animated .gifs and IM

Post by cassy »

fmw42 wrote:you could also coalesce the frames and then shrink them and put them back.

convert image.gif -coalesce -resize WidthxHeight newimage.gif
thanks or the hint! I have just updated the respecitve file accordingly and submitted all 15 images again. On first sight it looks like all thumbs animate in IE7 however I have yet to check out large images and other browsers.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: animated .gifs and IM

Post by fmw42 »

OK, it is most likely the different frame sizes in the un-coalesced gif that is causing the problem. Best to coalesce and regenerate. Alternately, look at the disposal in http://www.imagemagick.org/Usage/anim_basics/#dispose were it says:

"The first thing people creating GIF animation have trouble with is the "-dispose" setting. This is not surprising as it is a complex setting. Worse still a lot of animation programs, including many web browsers, don't always handle the GIF disposal meta-data setting correctly. However using the right disposal can make a big difference to how well your animation works and optimizes."
cassy

Re: animated .gifs and IM

Post by cassy »

snibgo wrote:It's strange that IE8 can animate some (eg "test mission rails with inserts") but not others (eg "test sato gates").

I downloaded the small "test sato gates" and tried:

convert sato_gates.gif sg1.gif
convert sato_gates.gif -coalesce sg2.gif

sg1.gif won't animate under IE8, but sg2.gif will. Perhaps IM does a simple copy for sg1, but for sg2 it has to unpack and re-pack.

According to identify -verbose, sato_gates.gif has frames of different sizes (239x168 and 240x155), and they have geometry offsets. sg2.gif doesn't.

Is there a "crop" somewhere in the IM chain without a corresponding "+repage"? Do you really want different frame sizes within an animation?
no there is no cropping only resizing, quality and unsharp - and now also coalesce.

weird that the thumb is coming with differently sized frames as checking the psd shows that the layers of the image are of identical size (1010x710)
cassy

Re: animated .gifs and IM

Post by cassy »

fmw42 wrote:OK, it is most likely the different frame sizes in the un-coalesced gif that is causing the problem. Best to coalesce and regenerate. Alternately, look at the disposal in http://www.imagemagick.org/Usage/anim_basics/#dispose were it says:

"The first thing people creating GIF animation have trouble with is the "-dispose" setting. This is not surprising as it is a complex setting. Worse still a lot of animation programs, including many web browsers, don't always handle the GIF disposal meta-data setting correctly. However using the right disposal can make a big difference to how well your animation works and optimizes."
that read about displosals is rather confusing.

since my images appear to be properly animating now (with coalesce added to the command line) I'm wondering what I need to do to get an actual movement like a launching rocket to preoperly animate? after all my images only need to display one frame after another with a bit of a delay in between.

reading the docu you mentioned about both coalesce and disposals makes me wonder how to further modify the command line.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: animated .gifs and IM

Post by snibgo »

The coalesced versions all animate under IE8.

A rocket launching would work in the same way. Good web practise provides a facility for the user to stop animations on a page.
snibgo's IM pages: im.snibgo.com
Post Reply