[Image-SIG] How to apply a threshold value to the image
export at hope.cz
export at hope.cz
Sat Nov 10 10:22:54 CET 2007
Can anyone give me an example how to apply a threshold value to an image?
(everything above a certain brightness level becomes white, and everything below the
level becomes black.)
I was told I should use 256-item mapping table and pass it to the "point" method.
But how should the 256-item mapping table look like, if the threshold is 18( found from the histogram)
Thank you for any hint.
L.
> export at hope.cz wrote:
>
> > I would need to apply a threshold value to the image, where everything
> > above a certain brightness level becomes white, and everything below the
> > level becomes black.
> > How can I do that with PIL?
>
> create a 256-item mapping table and pass it to the "point" method.
>
> </F>
>
> _______________________________________________
> Image-SIG maillist - Image-SIG at python.org
> http://mail.python.org/mailman/listinfo/image-sig
More information about the Image-SIG
mailing list