Page 2 of 2

Re: How to Change the Resolution of an Image

Posted: 2009-08-27T15:30:41-07:00
by fmw42
use -crop +repage. you can add that multiple time in a command line. Be sure to add +repage or you will not get the output as you want as it leaves the virtual canvas unchanged.

see -crop and +repage

http://www.imagemagick.org/script/comma ... s.php#crop
http://www.imagemagick.org/script/comma ... p#geometry
http://www.imagemagick.org/Usage/crop/#crop

convert input -crop ... +repage -crop ... +repage output

Re: How to Change the Resolution of an Image

Posted: 2009-08-27T21:07:35-07:00
by anthony
If you know the amount to remove from each side then 'chop' with gravity settings may be better. no need for +repage with chop.
http://www.imagemagick.org/Usage/crop/#chop

Actually you can do the four sides (with different amounts removed) with two -chops.

Code: Select all

   convert  ...   -gravity NorthWest -chop 10x20 \
                      -gravity SouthEast -chop 30x40 \
                 +gravity  ...

Re: How to Change the Resolution of an Image

Posted: 2009-08-27T21:56:39-07:00
by fmw42
Not sure if he wants one image cropped twice to one output or one image cropped twice to two separate outputs!

Re: How to Change the Resolution of an Image

Posted: 2009-08-28T06:48:46-07:00
by psuphish05
Guys, thanks again for all your help. I was able to do multiple crops on the image by specifying the crop command multiple times:

convert -density 300 BC122.eps -crop 100%x100%-XXX+0^ -crop 100%x100%+0+XXX^ -density 72 -quality 35 -resize 165x165 BC122.jpg

The XXX is just our crop value in pixels. The command above will crop the top and right sides of the image. I'm not too worried if this isn't fast or the cleanest way to do it - even though, I'd be interested to see how else it could be accomplished for my own good.

Thanks again, you guys have been a great help!

Re: How to Change the Resolution of an Image

Posted: 2009-08-28T09:16:09-07:00
by fmw42
see Anthony's reference to -chop, it will be shorter and more efficient.