mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-09-24 13:07:00 +03:00
Merge 6d974b61d6
into d70cba3762
This commit is contained in:
commit
95ba78c751
|
@ -107,6 +107,14 @@ def test_rgba_p() -> None:
|
|||
assert_image_similar(im, comparable, 20)
|
||||
|
||||
|
||||
def test_pa() -> None:
|
||||
im = hopper().convert("PA")
|
||||
|
||||
palette = im.palette
|
||||
assert palette is not None
|
||||
assert palette.colors != {}
|
||||
|
||||
|
||||
def test_rgba() -> None:
|
||||
with Image.open("Tests/images/transparent.png") as im:
|
||||
assert im.mode == "RGBA"
|
||||
|
|
|
@ -1142,7 +1142,7 @@ class Image:
|
|||
raise ValueError(msg) from e
|
||||
|
||||
new_im = self._new(im)
|
||||
if mode == "P" and palette != Palette.ADAPTIVE:
|
||||
if mode in ("P", "PA") and palette != Palette.ADAPTIVE:
|
||||
from . import ImagePalette
|
||||
|
||||
new_im.palette = ImagePalette.ImagePalette("RGB", im.getpalette("RGB"))
|
||||
|
|
Loading…
Reference in New Issue
Block a user