How to extract frames from a GIF file preserving frame dimensions

Joe Cabezas picture Joe Cabezas · Oct 9, 2012 · Viewed 28.2k times · Source

I have the following GIF image file:

original gif image

I want to extract its frames (using PGM output format) using this imagemagick command:

convert brocoli.gif out%05d.pgm

But each frame has a different size.

How can I extract its frames while preserving the original gif file size?

Answer

phreakhead picture phreakhead · Oct 10, 2012

Use the -coalesce option:

convert -coalesce brocoli.gif out%05d.pgm