Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

How can I easily split an animated .gif file? I want to see each frame.

I would really prefer to not to export every frame to a directory. I'd like to view them individually in one application if possible.

Is this possible on Linux?

share|improve this question

2 Answers 2

up vote 12 down vote accepted

Try opening them with The Gimp; I believe it will open animated gifs with one layer per frame.

You say you don't want to dump all frames to files on a directory, but I'll tell you how to do it anyway :) install either ImageMagick or graphicsmagick, then:

for ImageMagick:

convert animation.gif target.png

for graphicsmagick:

gm convert animation.gif target.png

it'll write frames to target0.png,target1.png,... and so on. You can then enter the directory and run eog, it'll show you all the frames on the same application. When you no longer need the frames, just rm target*.png.

share|improve this answer
    
imagemagick is just awesome!! –  fccoelho Jul 21 '13 at 23:24
    
imagemagic convert failed for me, since it seems that each image of the gif was represented as a new transparent backgrounds layer, and convert gave those transparent layers: upload.wikimedia.org/wikipedia/commons/5/5d/AstarExample.gif –  Ciro Santilli 六四事件 法轮功 纳米比亚 威视 Jul 25 '13 at 18:25
    
I opened my gif in gimp, but I still don't know how to view each frame individually - I just see the last frame. I'm working with this animation: /tmp/Non-Native-American-Nations-Territorial-Claims-over-NAFTA-countries-1750-20‌​08.gif –  nealmcb Mar 21 at 15:53

If the various frames have transparent areas and build upon each other, you can use the convert command with the "-coalesce" option to produce a set of files target-0.png, target-1.png etc, each of which merges the sequence of previous images:

convert -coalesce animation.gif target.png
share|improve this answer
    
Realy useful comment, thank you –  Selivanov Pavel Dec 19 '13 at 18:07
1  
Great comment but needs explanation. Basically it solves the problem @cirosantilli had with ImageMagick returning what looked liked updates to specific screen areas. -coalesce merges those updates to give you a finished rendering. –  AnthonyVO Jul 1 '14 at 12:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.