def image(self, image):
if image.mode != '<STR_LIT:1>':<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>imwidth, imheight = image.size<EOL>if imwidth != self.width or imheight != self.height:<EOL><INDENT>raise ValueError('<STR_LIT>'.format(self.width, self.height))<EOL><DEDENT>pix = image.load()<EOL>index = <NUM_LIT:0><EOL>for page in range(self._pages):<EOL><INDENT>for x in range(self.width):<EOL><INDENT>bits = <NUM_LIT:0><EOL>for bit in [<NUM_LIT:0>, <NUM_LIT:1>, <NUM_LIT:2>, <NUM_LIT:3>, <NUM_LIT:4>, <NUM_LIT:5>, <NUM_LIT:6>, <NUM_LIT:7>]:<EOL><INDENT>bits = bits << <NUM_LIT:1><EOL>bits |= <NUM_LIT:0> if pix[(x, page*<NUM_LIT:8>+<NUM_LIT:7>-bit)] == <NUM_LIT:0> else <NUM_LIT:1><EOL><DEDENT>self._buffer[index] = bits<EOL>index += <NUM_LIT:1><EOL><DEDENT><DEDENT>
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.