This commit is contained in:
wiredfool 2014-03-25 21:42:04 -07:00
parent 86ab020736
commit 9518214980
2 changed files with 14 additions and 1 deletions

View File

@ -46,5 +46,13 @@ def test_16bit_workaround():
im = Image.open('Tests/images/16bit.cropped.tif')
_test_float_conversion(im.convert('I'))
def test_rgba_p():
im = lena('RGBA')
im.putalpha(lena('L'))
converted = im.convert('P')
comparable = converted.convert('RGBA')
assert_image_similar(im, comparable, 20)

View File

@ -19,4 +19,9 @@ def test_octree_quantize():
im = im.quantize(100, Image.FASTOCTREE)
assert_image(im, "P", im.size)
assert len(im.getcolors()) == 100
assert len(im.getcolors()) == 100
def test_rgba_quantize():
im = lena('RGBA')
assert_no_exception(lambda: im.quantize())
assert_exception(Exception, lambda: im.quantize(method=0))