title: Convert a gray scal imageto bilevel
body: <p>I'm trying to convert an image to a binary image (bilevel) using the method "point" of PIL as following:</p>
  
  <pre><code>def mappoint (i):
     if i &gt; 1: return 1
     else: return 0
  
  if __name__=="__main__":
     img = Image.open('no.tif')
     img = img.point(mappoint)
     img.save('ok.tif')
  </code></pre>
  
  <p>but it gives me a black image !</p>
  
  <p>EDIT: If I do def <code>mappoint (i): if i &gt; 1: return 255</code> then it gives a all white image ! and if I print the value of i in mappoint it shows values from 0 to 255 (like if you do print range(256)), so each i is not the value of each pixels, is it ? There is another way to make the bilevel just by using convert when we open the image: img = <code>Image.open(img_name).convert('1')</code> but by default the threshold used is 127, and the doc says to use point method if we want another threshold</p>