[Image-SIG] grayscale image: find darkest pixel and delete lighter ones

Eduardo Ismael eismb at hotmail.com
Thu Apr 23 00:58:59 CEST 2009

I wonder if it is possible to do something like the following with the Python Imaging library:

for pixel in image:
    get how close to black it is
register what would be the darkest shade found in the image
delete pixels lighter than the darkest.

I'm asking because I scanned a bunch of pages from a book to .jpg. The images are in grayscale, and some pages have tables with gray background "underneath" black text, and I wanted to get rid of the background.



Descubra seu lado desconhecido com o novo Windows Live!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/image-sig/attachments/20090422/6921ef8e/attachment.htm>

More information about the Image-SIG mailing list