handling 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
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

handling gif

Post by manit »

i wanted to use http://upload.wikimedia.org/wikipedia/c ... ionGPS.gif
to get 24 frames from gif
I tried
montage -geometry +1+1 constellation.gif 1.jpg
Then I got a big file with hundreds of thumbnail but only one was clear while I think others denoted incremental change in original.
What I want to do is take out 24 complete clips from whole duration of gif.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: handling gif

Post by fmw42 »

use

convert constellation.gif -coalesce constellation_new.gif

to reconstitute the full frames from the partials. then select the frames you want for your montage or create a new gif will only the frames you want first.

see http://www.imagemagick.org/Usage/anim_basics/#coalesce
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

Thank you fmw42 and one more question

Post by manit »

Coalesce created a 1.3MB gif animation with complete frames.
i also read how animations are created by overlaying images & if just small change is stored in each frame (like the GPS gif I pointed to) then effect is same with small file-size.
QUESTION
i also read somewhere that gif has 256 colour palette( so suited for cartoon animations using single colour not many shades) . Is it true ? Then I think must be 2 bits for red,green.blue & alpha apiece.

The gif created a 5.7M jpg with 300 frames.
Can I extract every 10th frame from gif directly ?
Also how to find out time interval of gif ? I tried
identify -verbose File > 1.txt
then got 129400 line file at end of which there was elapsed time:16.Any smaller way ?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Thank you fmw42 and one more question

Post by fmw42 »

manit wrote: QUESTION
i also read somewhere that gif has 256 colour palette( so suited for cartoon animations using single colour not many shades) . Is it true ? Then I think must be 2 bits for red,green.blue & alpha apiece.

The gif created a 5.7M jpg with 300 frames.
Can I extract every 10th frame from gif directly ?
Also how to find out time interval of gif ? I tried
identify -verbose File > 1.txt
then got 129400 line file at end of which there was elapsed time:16.Any smaller way ?
Give uses a palette or list of colors, so not necessarily a given number of bits for each for R,G,B and it uses a 1 bit alpha channel (on or off)

see http://www.imagemagick.org/Usage/formats/#gif

For extracting frames you use the convention image.gif[#-#] for a continuous range of frames or image.gif[#] for a single frame. But I don't think IM has a skip convention. So you will need to write a script loop to select the frames you want and merge them into one image.

see http://www.imagemagick.org/Usage/basics/#sequence
Post Reply