This happens when I convert a GIF into a series of PNG files.

I convert a .gif animation to a series of .png using

convert ex.gif my_png_files_%d.png

I get a series of .png-figures but some of the figures seem to be slightly shifted to the side or up/down. Example: if the gif-animation was just a red circle centred in the middle of a square, then the series of the pngs would produce this circle but this circle would be slight shifted off center in some direction in some of the pngs.

Anyone know what the issue is here?


First, shouldn't your example be :

convert ex.gif my_png_files_%d.png

as the input file is the GIF?

Could this be an anti-aliasing problem? Have you tried

convert ex.gif +antialiasing my_png_files_%d.png

I assume you have read the manual or the local copy at file:///opt/local/share/doc/ImageMagick-6.8.0/www/convert.html

EDIT: It turned out to be a geometry problem and the answer found here https://stackoverflow.com/questions/12791505/how-to-extract-frames-from-a-gif-file-preserving-frame-dimensions was to change the command to

convert -coalesce ex.gif +antialiasing my_png_files_%d.png
  • You're right on the first point, it was a misprint, sorry. – Your Majesty Jan 15 '14 at 0:42
  • On the second point, it gives the error: convert: UnrecognizedOption `+antialiasing' @ error/convert.c/ConvertImageCommand/720. – Your Majesty Jan 15 '14 at 0:46
  • Always best to use copy and paste :) – Tony Williams Jan 15 '14 at 0:46
  • The +antialiasing didn't work, it produces an error. – Your Majesty Jan 15 '14 at 0:52
  • It seems that the individual PNGs are of different sizes when they should all have identical sizes. Do you have any idea where this size difference comes from? – Your Majesty Jan 15 '14 at 0:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .