How can I split an animated .gif file into its component frames?

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?

4 Answers

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.

5

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
3

for me, with ImageMagick (version info: 6.8.9-9 Q16 x86_64 2017-07-31)

convert gif.gif gif.pdf

makes a pdf with each page being a frame of the input gif, then you can just page through the frames in the pdf viewing application of your choosing

2

Use mpv . Open it on desktop . Drag gif into it. Take a screenshot of your desired/single frame with s key. You may even pause if your gif is fast. Very Quick way.

===========

you may want to use these settings first [once set you do not have to do again]:

gedit ~/.config/mpv/mpv.conf

and enter and save:

--screenshot-format Choices: jpg jpeg png (default: jpg)

for highest png quality:

--screenshot-format=png
--screenshot-png-compression=9

or if you want jpg

--screenshot-jpeg-quality Integer (0 to 100) (default: 90)

Use mpv --list-options for other details

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like