From fd8dbdb08ccad767768137c11167297c3b9189c3 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sat, 27 Sep 2014 12:29:23 +0100 Subject: [PATCH] more colour tests --- python/test_colour.py | 11 +++++++++++ python/test_conversion.py | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/python/test_colour.py b/python/test_colour.py index c31d1546..bdd895cb 100755 --- a/python/test_colour.py +++ b/python/test_colour.py @@ -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) diff --git a/python/test_conversion.py b/python/test_conversion.py index 9b19263b..7cca0b29 100755 --- a/python/test_conversion.py +++ b/python/test_conversion.py @@ -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()