Page 1 of 1

convert -crop png into gif

Posted: 2011-10-12T09:09:42-07:00
by jejeking
Hi all,

I would like to crop and convert a 501x501 png into a 500x500 gif file.
I only want to crop and not re-size as I only want to get rid of the last row and column pixel.

When I try this command:
convert image.png -crop 500x500+0+0 new_image.gif
This gives me a 501x501 gif.

So I tried this:
convert image.png -crop 500x500+0+0 new_image.png
This gives me a 500x500 png.

Now, if I do this:
convert new_image.png new_image.gif
I still end up with a 501x501 gif file.

I must be missing something.
Thanks for your help!
Jerome.

Re: convert -crop png into gif

Posted: 2011-10-12T10:30:32-07:00
by fmw42
remove the virtual canvas using +repage

convert image.png -crop 500x500+0+0 +repage new_image.gif

see http://www.imagemagick.org/Usage/crop/#crop_repage

Re: convert -crop png into gif

Posted: 2011-10-12T11:28:32-07:00
by jejeking
Thanks!
That worked like a charm.
Jerome.