width and height of non transparent part of image

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
puneetht

width and height of non transparent part of image

Post 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
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: width and height of non transparent part of image

Post 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
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply