How do I convert (.gif to .png) this image to get the original view?

I am trying to convert this image, , to a series of .png files.

This was pretty simple, I used the convert command in Linux:

convert Dijkstra_Animation.gif dijkstra.png

The command went fine and produced the 27 frames, as reported at the bottom of the original page.

However, I find that some of the produced .png files are only single numbers or arrows. Which is different from what I expected.

I want the .png files to be a simple sequence in the same way the .gif file is showing.

Could you please suggest a method (for Linux please) to achieve this?

0

2 Answers

Using the -coalesce option will do the wonder.

Like this,

convert -verbose -coalesce Dijkstra_Animation.gif dijkstra.png

Actually the -coalesce option "merges a sequence of images" as is claimed in the manual page.

2

If convert does not work for you and you are a Mac user, you can try sips, which comes with your MacOS. For example, you can convert a GIF image into a PNG image:

sips -s format png 1.gif --out 1.png

You can also convert a folder filled with GIFs to PNGs saved in folder pngs:

sips -s format png gifs/*.gif --out pngs

More about sips. It is an abbreviation of Scriptable image processing system. It is used to query or modify raster image files (JPG/GIF/PNG). Image processing options include flip, rotate, change image format/width/height. You can find more details in its manual: in command line man sips or at online manual.

FYI, my MacOS release (obtained by uname -rsv) is:

Darwin 18.2.0 Darwin Kernel Version 18.2.0: Mon Nov 12 20:24:46 PST 2018; root:xnu-4903.231.4~2/RELEASE_X86_64
0

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