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

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.


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