[Image-SIG] How to apply a threshold value to the image

Fredrik Lundh fredrik at pythonware.com
Thu Nov 8 22:21:52 CET 2007


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>



More information about the Image-SIG mailing list