determine amount of frames in animated gif

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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

To determines the number of frames in an animated GIF image, use the identify command, for example:
  • identify animate.gif
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony »

To append to the bottom of all frames, you don't need to know how many frames their are. You only need to work out a technique that will add it to ALL frames at the same time..

Append is not the solution as it ia multi image orperator.

Try using splice to add space, the -draw image to overlay the image you want
into that space. Both operations understand gravity!

Altrunativally, for a GIF animation that is an simple 'overlay' animation just expand and add the label to the first frame. It will remain on each of the later frames :-)

This is the exact same technique that was used to replace a transparent background of a GIF animation..
http://www.cit.gu.edu.au/~anthony/graph ... s/#flatten
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony »

First your $i may not be a two character digit, which you said you need.

As for the Assertion, what version are you using. I have notified chrisy of such failures when I have seen then with the smallest command I can figure out that has that problem. Assertion failure generally point to some more serious mistake in the coding, and should NOT happen. Make sure you update you IM version, and try again, then report the minimal command that causes it.

PS: -transparent white is no longer a GIF handling option. It just converts any color that is purely the color given to transparency (automatically adding a alpha channel if needed). EG it is a special form of -opaque operator.
IM examples rough notes, on specific color replacement...
http://www.cit.gu.edu.au/~anthony/graph ... e/#replace

To set the GIF transparency color (which can co-exist with the same opaque color)
use -transparent-color. See latest updates in..
http://www.cit.gu.edu.au/~anthony/graph ... #gif_trans
this is with the latest versions on IM.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply