mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 17:24:31 +03:00
added lab->srgb and srgb->lab->srgb tests
This commit is contained in:
parent
ace78d0734
commit
215b61aadf
|
@ -108,3 +108,25 @@ def test_lab_color():
|
|||
target = Image.open('Tests/images/lena.Lab.tif')
|
||||
|
||||
assert_image_similar(i, target, 1)
|
||||
|
||||
def test_lab_srgb():
|
||||
pLab = ImageCms.createProfile("LAB")
|
||||
t = ImageCms.buildTransform(pLab, SRGB, "LAB", "RGB")
|
||||
|
||||
img = Image.open('Tests/images/lena.Lab.tif')
|
||||
|
||||
img_srgb = ImageCms.applyTransform(img, t)
|
||||
|
||||
assert_image_similar(lena(), img_srgb, 1)
|
||||
|
||||
def test_lab_roundtrip():
|
||||
# check to see if we're at least internally consistent.
|
||||
pLab = ImageCms.createProfile("LAB")
|
||||
t = ImageCms.buildTransform(SRGB, pLab, "RGB", "LAB")
|
||||
|
||||
t2 = ImageCms.buildTransform(pLab, SRGB, "LAB", "RGB")
|
||||
|
||||
i = ImageCms.applyTransform(lena(), t)
|
||||
out = ImageCms.applyTransform(i, t2)
|
||||
|
||||
assert_image_similar(lena(), out, 2)
|
||||
|
|
Loading…
Reference in New Issue
Block a user