border thickness

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
toshog
Posts: 23
Joined: 2010-02-12T19:29:43-07:00
Authentication code: 8675308

border thickness

Post by toshog »

hi all...

what is the best way to find out what the border thickness(es) of an image is (are) of scanned documents so i can either shave them or crop them.

and also is there a way to "deskew" and image by computing the skew angle like here (Fig.3):
http://www.leptonica.org/line-removal.html


thanks...
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: border thickness

Post by fmw42 »

I don't believe that IM has a unique function to tell you how big a border is. You have to trim it and look at the virtual canvas and image size from identify to figure out how big the border was after it was trimmed.

just use convert image -fuzz XX% -trim +repage result and it will trim automatically to the min bounding box. Leave off the +repage if you want to see the size and offset from identify to figure out how big the border was before it was trimmed.

IM has a -deskew to unrotate image.

You might also want to see my scripts, unrotate, autotrim, multicrop and separate at the link below. They are unix bash scripts.
toshog
Posts: 23
Joined: 2010-02-12T19:29:43-07:00
Authentication code: 8675308

Re: border thickness

Post by toshog »

fmw42 wrote:You might also want to see my scripts, unrotate, autotrim, multicrop and separate at the link below. They are unix bash scripts.
thanks. appreciated...
Post Reply