Posted: 2006-11-17T02:01:45-07:00
If there is only one such area, you can do something like this...
to ouptut the minimal rectangle for that area.
This converts pure white into a shaped mask and thing -trim is used to locate that area.
Add a -fuzz factor if the white is not pure white. See
http://www.cit.gu.edu.au/~anthony/graph ... olor/#fuzz
If multiple areas are posible, then you will need to also generate that mask, but you will probably have to do something like a "-verbose -segment arg" to find them. I have not however played much with -segment, so I would love to know what you come up with.
Code: Select all
convert image.jpg -matte -fill none -opacity white \
-fill white -colorize 100% -trim info:
This converts pure white into a shaped mask and thing -trim is used to locate that area.
Add a -fuzz factor if the white is not pure white. See
http://www.cit.gu.edu.au/~anthony/graph ... olor/#fuzz
If multiple areas are posible, then you will need to also generate that mask, but you will probably have to do something like a "-verbose -segment arg" to find them. I have not however played much with -segment, so I would love to know what you come up with.