How do I identify border around the image?

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.

Re: How do I identify border around the image?

Postby fmw42 » 2009-03-28T11:52:27+00:00

developer wrote:I need to be able to find a border around the image. The border can be either of the same color or shaded.


I am not sure I understand what you are asking!

I don't think IM can just tell you directly if/where a border is located and how big it is.

But you can extract a mask image that might contain just the border.

try -fuzz XX% -threshold XX%

see
http://www.imagemagick.org/script/comma ... ptions.php
http://www.imagemagick.org/Usage/quantize/#threshold

That will create a binary image that might show the border only. This mask can be used for further processing.

If you want to ADD or REMOVE a known size border see
http://www.imagemagick.org/Usage/crop/
User avatar
fmw42
 
Posts: 4455
Joined: 2007-07-02T17:14:51+00:00
Location: Sunnyvale, California, USA

Re: How do I identify border around the image?

Postby anthony » 2009-04-27T21:53:12+00:00

Also look at using -fuzz and -trim
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
http://www.imagemagick.org/Usage/
User avatar
anthony
 
Posts: 4377
Joined: 2004-05-31T19:27:03+00:00
Location: Brisbane, Australia


Return to Developers

Who is online

Users browsing this forum: Ask Jeeves [Bot] and 2 guests