Exemplo n.º 1
0
 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))
Exemplo n.º 2
0
 def test_non_indexed_interlaced(self):
     with open(get_test_file(__file__, 'black-white-non-indexed-interlaced-adam7.png'), 'rb') as fobj:
         img = open_image(fobj)
         self.assertEqual(img.get_color(0, 0), Black)
         self.assertEqual(img.get_color(1, 1), Black)
         self.assertEqual(img.get_color(0, 1), White)
         self.assertEqual(img.get_color(1, 0), White)
Exemplo n.º 3
0
 def test_save(self):
     with open(get_test_file(__file__, 'black-white-with-transparency.png'), 'rb') as fobj:
         img = open_image(fobj)
         sio = StringIO()
         write(img, sio)