code: def image(self, img):
          
          if img.mode != '1':
              raise ValueError('Image must be in mode 1.')
          imwidth, imheight = img.size
          if imwidth != self.width or imheight != self.height:
              raise ValueError('Image must be same dimensions as display ({0}x{1}).' \
                  .format(self.width, self.height))
          # Grab all the pixels from the image, faster than getpixel.
          pixels = img.load()
          # Clear buffer
          for i in range(len(self.buf)):
              self.buf[i] = 0
          # Iterate through the pixels
          for x in range(self.width):       # yes this double loop is slow,
              for y in range(self.height):  #  but these displays are small!
                  if pixels[(x, y)]:
                      self.pixel(x, y, 1)
docs: Set buffer to value of Python Imaging Library image.  The image should
          be in 1 bit mode and a size equal to the display size.