def test_correctness(self): identity = identity_table(16) image = Image.open(resource('files', 'hald.4.png')) lut_numpy = load_hald_image(image) self.assertEqualLuts(lut_numpy, identity) with disable_numpy(loaders): lut_pillow = load_hald_image(image) self.assertEqualLuts(lut_pillow, identity)
def test_application(self): im = Image.new('RGB', (10, 10)) hald = Image.open(resource('files', 'hald.4.png')) lut_numpy = load_hald_image(hald) self.assertEqual(lut_numpy.table.__class__.__name__, 'ndarray') im.filter(lut_numpy) with disable_numpy(loaders): lut_native = load_hald_image(hald) self.assertEqual(lut_native.table.__class__.__name__, 'list') im.filter(lut_native)