def test_with_transparency(self): with open(get_test_file(__file__, 'black-white-with-transparency.png'), 'rb') as fobj: img = PNG.decode(fobj) self.assertEqual(img.get_color(0, 0), Black) self.assertEqual(img.get_color(1, 0), White) self.assertEqual(img.get_color(1, 1), Black.get_for_brightness(0.5)) self.assertEqual(img.get_color(0, 1), White.get_for_brightness(0.5))
def test_with_transparency(self): with open(get_test_file(__file__, 'black-white-with-transparency.png'), 'rb') as fobj: img = open_image(fobj) self.assertEqual(img.get_color(0, 0), Black) self.assertEqual(img.get_color(1, 0), White) self.assertEqual(img.get_color(1, 1), Black.get_for_brightness(0.5)) self.assertEqual(img.get_color(0, 1), White.get_for_brightness(0.5))