Adjust test for the gamma of 2.2 encoded into the file

This commit is contained in:
hugovk 2017-06-13 23:07:46 +03:00
parent b7d14b04b6
commit 2d02f4ea9b

View File

@ -1,6 +1,6 @@
from helper import unittest, PillowTestCase, hopper
from PIL import Image, MicImagePlugin
from PIL import Image, ImagePalette, MicImagePlugin
TEST_FILE = "Tests/images/hopper.mic"
@ -14,8 +14,12 @@ class TestFileMic(PillowTestCase):
self.assertEqual(im.size, (128, 128))
self.assertEqual(im.format, "MIC")
# Adjust for the gamma of 2.2 encoded into the file
lut = ImagePalette.make_gamma_lut(1/2.2)
im = Image.merge('RGBA', [chan.point(lut) for chan in im.split()])
im2 = hopper("RGBA")
self.assert_image_similar(im, im2, 123.5)
self.assert_image_similar(im, im2, 10)
def test_n_frames(self):
im = Image.open(TEST_FILE)