more colour tests
This commit is contained in:
parent
e458365970
commit
fd8dbdb08c
@ -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)
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user