more colour tests

This commit is contained in:
John Cupitt 2014-09-27 12:29:23 +01:00
parent e458365970
commit fd8dbdb08c
2 changed files with 13 additions and 2 deletions

View File

@ -125,6 +125,17 @@ class TestColour(unittest.TestCase):
after = im.getpoint(10, 10)
self.assertAlmostEqualObjects(before, after, places = 1)
# go between every pair of colour spaces
for start in colour_colourspaces:
for end in colour_colourspaces:
im = test.colourspace(start)
im2 = im.colourspace(end)
im3 = im2.colourspace(Vips.Interpretation.LAB)
before = test.getpoint(10, 10)
after = im3.getpoint(10, 10)
self.assertAlmostEqualObjects(before, after, places = 1)
# test Lab->XYZ on mid-grey
# checked against http://www.brucelindbloom.com
im = test.colourspace(Vips.Interpretation.XYZ)

View File

@ -299,8 +299,8 @@ class TestConversion(unittest.TestCase):
pixel = im.getpoint(30, 30)
print pixel
self.assertAlmostEqualObjects(pixel, [50, 51, 51])
if __name__ == '__main__':
unittest.main()