Page 1 of 1

Cropping GIF produces 'animated' gif

Posted: 2010-01-15T22:34:37-07:00
by vinaur
I have a single frame gif image (1000 pixels wide) and I want to crop it to get just the bottom 1000x60 pixel area.

First of all, this is the gif I start with:

Code: Select all

$ identify ABCA1.gif
ABCA1.gif GIF 1000x141 1000x141+0+0 8-bit PseudoClass 256c 9.33kb
I run the following command:

Code: Select all

$ convert ABCA1.gif -gravity South -crop 1000x60 +repage a.gif
The resulting image:

Code: Select all

$ identify a.gif
a.gif[0] GIF 1000x60 1000x60+0+0 8-bit PseudoClass 256c 9.97kb
a.gif[1] GIF 1000x60 1000x60+0+0 8-bit PseudoClass 256c 9.97kb
a.gif[2] GIF 1000x21 1000x60+0+0 8-bit PseudoClass 256c 9.97kb
My version information:

Code: Select all

$ convert -version
Version: ImageMagick 6.4.5 2009-06-04 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC
Why in the world are there 3 frames? How do I get it to crop and create a single frame gif? (The image does not render using Windows Picture and Fax Viewer)

Thanks a lot!

Re: Cropping GIF produces 'animated' gif

Posted: 2010-01-16T06:13:12-07:00
by rockcreekdan
Specify the full geometry when you crop:

Code: Select all

$ convert ABCA1.gif -gravity South -crop 1000x60+0+0 +repage a.gif
My understanding is that without the +0+0 offset, crop basically splits the source into tiles of size 1000x60. Since your source image is 1000x141, it splits it into three tiles: two 1000x60, and one 1000x21.

Re: Cropping GIF produces 'animated' gif

Posted: 2010-01-16T11:56:08-07:00
by vinaur
Thank you!

That did the trick. :-)