[Image-SIG] Trim borders?
bigmattyh at gmail.com
Tue Jul 15 20:24:01 CEST 2008
Is there a straightforward way to trim off the borders of an image, using
ImageMagick has a similar function called trim(), that looks at the 4
corner-pixels of the image, figures out what color the border is, and then
trims out rows and columns from the image's edges until it reaches a portion
of the image that doesn't match the border color. (I believe the function
also has a variable tolerance setting, where you can specify a range of
color where the matched border color would be considered to be a part of the
I see that there's a crop() function in PIL, but as you can see, the key to
the trim() function is that the library automatically figures out where the
border is and crops the image accordingly.
Thanks for the help.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Image-SIG