How to create a new image from another - ImageMagick -


i haven't been able find answers this, maybe i'm not looking in right place, thought check here. sure there simple answers (provided know them, of course).

let's have image 1000x2000. want use imagemagick take region of image (starting @ 40x50, , of size 100x200) , create image, same dimensions region (i.e. 100x200). how do this?

and then, if wanted resize original image 800x1600, command this?

thanks!

for cropping out region, try, ooh, don't know, maybe -crop? (searching "imagemagick crop" take imagemagick crop page, http://www.imagemagick.org/usage/crop/)

convert input.jpg -crop 100x200+40+50 +repage output.jpg 

here +repage ensure output image size of crop (as mentioned in above link).

for resizing, try (want guess?) -resize or -scale (and again, googling "imagemagick resize" have brought http://www.imagemagick.org/usage/resize/, , excellent resource)):

e.g.

convert input.jpg -resize 800x1600 output.jpg convert input.jpg -scale '80%' output.jpg 

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -