Image.point tests for Float LUT

This commit is contained in:
wiredfool 2014-07-28 21:49:11 -07:00
parent ea0a31d9fe
commit 78d2618064

View File

@ -31,6 +31,16 @@ class TestImagePoint(PillowTestCase):
im = lena("I")
im.point(list(range(256))*256, 'L')
def test_f_lut(self):
""" Tests for floating point lut of 8bit gray image """
im = lena('L')
lut = [0.5 * float(x) for x in range(256)]
out = im.point(lut, 'F')
int_lut = [x//2 for x in range(256)]
self.assert_image_equal(out.convert('L'), im.point(int_lut, 'L'))
if __name__ == '__main__':
unittest.main()