diff --git a/Tests/test_image_convert.py b/Tests/test_image_convert.py index fd3d39bc5..d3bdb519c 100644 --- a/Tests/test_image_convert.py +++ b/Tests/test_image_convert.py @@ -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) + diff --git a/Tests/test_image_quantize.py b/Tests/test_image_quantize.py index 70b5eb503..dbf68a25e 100644 --- a/Tests/test_image_quantize.py +++ b/Tests/test_image_quantize.py @@ -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 \ No newline at end of file + 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))