This commit is contained in:
bigcat88 2022-10-31 16:16:16 +03:00
parent a4ec9f331c
commit 0671695e8e
No known key found for this signature in database
GPG Key ID: 1F0BF0EC3CF22721
2 changed files with 15 additions and 0 deletions

View File

@ -338,3 +338,17 @@ def test_matrix_identity():
# Assert
# No change
assert_image_equal(converted_im, im)
def test_rgba_premultiplied_to_rgb():
im = Image.merge(
"RGBa",
[
Image.new(mode="L", size=(1, 1), color=128),
Image.new(mode="L", size=(1, 1), color=255),
Image.new(mode="L", size=(1, 1), color=64),
Image.new(mode="L", size=(1, 1), color=64),
],
)
im = im.convert(mode="RGB")
assert im.getpixel((0, 0)) == (32, 64, 16)

View File

@ -933,6 +933,7 @@ static struct {
{"RGBA", "YCbCr", ImagingConvertRGB2YCbCr},
{"RGBA", "HSV", rgb2hsv},
{"RGBa", "RGB", rgbA2rgba},
{"RGBa", "RGBA", rgba2rgbA},
{"RGBX", "1", rgb2bit},