diff --git a/Tests/images/rgb_trns.png b/Tests/images/rgb_trns.png new file mode 100644 index 000000000..dee80acdc Binary files /dev/null and b/Tests/images/rgb_trns.png differ diff --git a/Tests/test_file_png.py b/Tests/test_file_png.py index 5ae726ad8..98f2cec6d 100644 --- a/Tests/test_file_png.py +++ b/Tests/test_file_png.py @@ -150,6 +150,17 @@ def test_load_transparent_p(): # image has 124 uniqe qlpha values assert_equal(len(im.split()[3].getcolors()), 124) +def test_load_transparent_rgb(): + file = "Tests/images/rgb_trns.png" + im = Image.open(file) + + assert_image(im, "RGB", (64, 64)) + im = im.convert("RGBA") + assert_image(im, "RGBA", (64, 64)) + + # image has 867 transparent pixels + assert_equal(im.split()[3].getcolors()[0][0], 867) + def test_save_p_transparent_palette(): in_file = "Tests/images/pil123p.png" im = Image.open(in_file)