def get_frame_buffer(self, image):
    buf = ([255] * int(((self.width * self.height) / 8)))
    image_monocolor = image.convert('1')
    (imwidth, imheight) = image_monocolor.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))
    pixels = image_monocolor.load()
    for y in range(self.height):
        for x in range(self.width):
            if (pixels[(x, y)] == 0):
                buf[int(((x + (y * self.width)) / 8))] &= (~ (128 >> (x % 8)))
    return buf
def get_frame_buffer(self, image):
    buf = ([255] * int(((self.width * self.height) / 8)))
    image_monocolor = image.convert('1')
    (imwidth, imheight) = image_monocolor.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))
    pixels = image_monocolor.load()
    for y in range(self.height):
        for x in range(self.width):
            if (pixels[(x, y)] == 0):
                buf[int(((x + (y * self.width)) / 8))] &= (~ (128 >> (x % 8)))
    return buf