Page 1 of 1

find coordinates of bounding box of transparent pixels

Posted: 2014-09-13T20:10:44-07:00
by ravikum
Hello,
I have some png images with transparent areas like this with one or more holes :
Image

Image

the edges are semi transparent.

Please help me in finding the coordinates of the top left corner and bottom right corner of the bounding box of the transparent area like this.
Image

Image

Thanks

Re: find coordinates of bounding box of transparent pixels

Posted: 2014-09-13T21:50:27-07:00
by fmw42
see -trim or string format "%@"

Code: Select all

convert dwrl3t.png -format "%@" info:
56x70+22+55

see
http://www.imagemagick.org/script/comma ... s.php#trim
http://www.imagemagick.org/script/escape.php

Re: find coordinates of bounding box of transparent pixels

Posted: 2014-09-13T22:07:03-07:00
by ravikum
Thanks a lot.
It worked very well.