convert -crop png into gif

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
jejeking
Posts: 2
Joined: 2011-10-12T07:48:12-07:00
Authentication code: 8675308

convert -crop png into gif

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert -crop png into gif

Post 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
jejeking
Posts: 2
Joined: 2011-10-12T07:48:12-07:00
Authentication code: 8675308

Re: convert -crop png into gif

Post by jejeking »

Thanks!
That worked like a charm.
Jerome.
Post Reply