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
How to Change the Resolution of an Image
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: How to Change the Resolution of an Image
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.
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 ...
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to Change the Resolution of an Image
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
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!
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!
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to Change the Resolution of an Image
see Anthony's reference to -chop, it will be shorter and more efficient.