Konvertierung von GIF in PNG funktioniert nicht

1132
user774743

Ich suchte nach einer Möglichkeit, eine animierte GIF in die Bilder zu zerlegen, aus denen sie besteht, und fand viele Threads, die Folgendes empfehlen:

convert -coalesce Dijkstra_Animation.gif djik.png 

Ich habe diesen Befehl ausgeführt, aber er schlägt fehl. Es erzeugt nur eine Datei ( djik.png) zum Booten, und obwohl seine Erweiterung ist .png, ist es tatsächlich die Eingabe GIF ... Was läuft falsch? Wie kann ich ein GIF mit mehreren Frames in seine einzelnen Frames zerlegen?

0

1 Antwort auf die Frage

0
Anaksunaman

The correct command should be:

 convert animated.gif output.png 

This will create output-0, output-1, output-2, etc. for each frame of animated gif.

As a side note, depending on how the GIF was processed, you may or may not get "full" frames. Some GIFs have frames that only contain partial data. These are the types of GIFs you would use -coalesce on to reconstruct each individual frame i.e.

convert -coalesce animated.gif output.png 

That said, you may wish to double check that the file you have is indeed an animated GIF. Anecdotally, I had an experience with giphy.com where an apparent error in conversion (they store "GIFs" as video) led to only a single frame being downloaded, even though it was still given a .gif extension.