Page 1 of 1

Cropping information for a image

Posted: 2011-05-14T08:31:05-07:00
by vinkolar
Hello all,
I have a image complete.tif with size 1228x567. A part of this image (with size 655x376) has pixels that correspond to an actual picture. Rest of the pixels have transparent background (no color). When I crop using

Code: Select all

convert complete.tif -trim cropped.tif
I get a cropped image of size 655x376.

Now, I need the information the co-ordinates of the bounding box of the picture inside the original image complete.tif. Is there any command that peeps through complete.tif and provides information about the bounding box for the actual picture? (say, "roll complete.tif by 10 pixels to the right and 50 pixels down to get the actual picture aligned to left-top corner")?

Thanks
Vinay

Re: Cropping information for a image

Posted: 2011-05-14T10:25:47-07:00
by fmw42
identify -verbose cropped.tiff

look at the page geometry and origin geometry

or use string formats http://www.imagemagick.org/script/escape.php

convert cropped.tiff -format -format "%X%Y" info:

Re: Cropping information for a image

Posted: 2011-05-15T05:45:15-07:00
by anthony
See, Fuzzy/Blurred Trim for details.
http://www.imagemagick.org/Usage/crop/#trim_blur