コード例 #1
0
def test_imagepalette():
    im = hopper("P")
    im.putpalette(ImagePalette.negative())
    assert_image_equal_tofile(im.convert("RGB"), "Tests/images/palette_negative.png")

    im.putpalette(ImagePalette.random())

    im.putpalette(ImagePalette.sepia())
    assert_image_equal_tofile(im.convert("RGB"), "Tests/images/palette_sepia.png")

    im.putpalette(ImagePalette.wedge())
    assert_image_equal_tofile(im.convert("RGB"), "Tests/images/palette_wedge.png")
コード例 #2
0
 def test_imagepalette(self):
     im = hopper("P")
     im.putpalette(ImagePalette.negative())
     im.putpalette(ImagePalette.random())
     im.putpalette(ImagePalette.sepia())
     im.putpalette(ImagePalette.wedge())
コード例 #3
0
def test_imagepalette():
    im = lena("P")
    assert_no_exception(lambda: im.putpalette(ImagePalette.negative()))
    assert_no_exception(lambda: im.putpalette(ImagePalette.random()))
    assert_no_exception(lambda: im.putpalette(ImagePalette.sepia()))
    assert_no_exception(lambda: im.putpalette(ImagePalette.wedge()))
コード例 #4
0
 def test_imagepalette(self):
     im = lena("P")
     im.putpalette(ImagePalette.negative())
     im.putpalette(ImagePalette.random())
     im.putpalette(ImagePalette.sepia())
     im.putpalette(ImagePalette.wedge())