Page 1 of 1

width and height of non transparent part of image

Posted: 2010-10-07T00:09:08-07:00
by puneetht
I have an image of an irregular black object on a white background. I make background transparent using IMagemagick command.

Now I want to know the maximum width and maximum height of the black object on the image in pixels . Are there any quick ways to get this information.

Thanks in advance

Re: width and height of non transparent part of image

Posted: 2010-10-07T05:47:39-07:00
by anthony
-trim the image then use -verbose info: or an identify to output the size and location of the 'crop' the trim performed.

See IM Examples Trim
http://www.imagemagick.org/Usage/crop/#trim