mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-06-29 09:23:11 +03:00
Test no change with identity matrix
This commit is contained in:
parent
7fba16b074
commit
04e3f585b0
|
@ -187,6 +187,23 @@ class TestImageConvert(PillowTestCase):
|
||||||
matrix_convert('RGB')
|
matrix_convert('RGB')
|
||||||
matrix_convert('L')
|
matrix_convert('L')
|
||||||
|
|
||||||
|
def test_matrix_identity(self):
|
||||||
|
# Arrange
|
||||||
|
im = hopper('RGB')
|
||||||
|
identity_matrix = (
|
||||||
|
1, 0, 0, 0,
|
||||||
|
0, 1, 0, 0,
|
||||||
|
0, 0, 1, 0)
|
||||||
|
self.assertEqual(im.mode, 'RGB')
|
||||||
|
|
||||||
|
# Act
|
||||||
|
# Convert with an identity matrix
|
||||||
|
converted_im = im.convert(mode='RGB', matrix=identity_matrix)
|
||||||
|
|
||||||
|
# Assert
|
||||||
|
# No change
|
||||||
|
self.assert_image_equal(converted_im, im)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user