Tight similarity tests for XYZ conversion

This commit is contained in:
wiredfool 2017-02-20 13:41:28 -08:00
parent 04e3f585b0
commit d707cb3692
2 changed files with 5 additions and 1 deletions

BIN
Tests/images/hopper-XYZ.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

@ -181,8 +181,12 @@ class TestImageConvert(PillowTestCase):
# Assert
self.assertEqual(converted_im.mode, mode)
self.assertEqual(converted_im.size, im.size)
target = Image.open('Tests/images/hopper-XYZ.png')
if converted_im.mode == 'RGB':
self.assert_image_similar(converted_im, im, 33)
self.assert_image_similar(converted_im, target, 3)
else:
self.assert_image_similar(converted_im, target.split()[0], 1)
matrix_convert('RGB')
matrix_convert('L')