title: Drawing multilingual text using PIL and saving as 1-bit and 8-bit bitmaps
body: <p>I started with the script in <a href="https://stackoverflow.com/a/11458418/3904031">this nice answer</a>. It works just fine for "RGB", but the 8-bit gray scale "L" and 1-bit black/white "1" PIL image modes just appear black. What am I doing wrong?</p>
  
  <pre><code>from PIL import Image, ImageDraw, ImageFont
  import numpy as np
  
  w_disp   = 128
  h_disp   =  64
  fontsize =  32
  text     =  u"你好!"
  
  for imtype in "1", "L", "RGB":
      image = Image.new(imtype, (w_disp, h_disp))
      draw  = ImageDraw.Draw(image)
      font  = ImageFont.truetype("/Library/Fonts/Arial Unicode.ttf", fontsize)
      w, h  = draw.textsize(text, font=font)
      draw.text(((w_disp - w)/2, (h_disp - h)/2), text, font=font)
      image.save("NiHao! 2 " + imtype + ".bmp")
      data = np.array(list(image.getdata()))
      print data.shape, data.dtype, "min=", data.min(), "max=", data.max()
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>(8192,) int64 min= 0 max= 0
  (8192,) int64 min= 0 max= 0
  (8192, 3) int64 min= 0 max= 255
  </code></pre>
  
  <p><code>imtype =   "1":</code> <a href="https://i.stack.imgur.com/Y8ImW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Y8ImW.png" alt="enter image description here"></a></p>
  
  <p><code>imtype =   "L":</code> <a href="https://i.stack.imgur.com/7WgVp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7WgVp.png" alt="enter image description here"></a></p>
  
  <p><code>imtype = "RGB":</code> <a href="https://i.stack.imgur.com/JhI0j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JhI0j.png" alt="enter image description here"></a></p>