New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8.3.0: convert
on a P image with transparency now returns a RGB image (used to be RGBA)
#5593
Comments
convert
on a P image with transparency now returns a RGB image (use to be RGBA) convert
on a P image with transparency now returns a RGB image (used to be RGBA)
I am facing a similar issue when converting a P image into LA: values of the transparency channel are all 255 with from PIL import Image
import numpy as np
# same image that OP mentioned https://gist.github.com/benjaminrigaud/d98a4b54fb409bc8f745d169df0196fc
path = the_path_here
with Image.open(path) as img:
img = img.convert("LA")
np.unique(np.asarray(img)[:, :, -1]) This will print Using another P image like https://github.com/pytorch/vision/blob/master/test/assets/fakedata/logos/palette_pytorch.png, the results are even more drastic:
|
I've created #5606 to fix this second problem. I validated the result just by visually inspecting the output. |
What did you do?
I converted an image in P mode with transparency on the new 8.3.0 release.
What did you expect to happen?
I expected the output to be RGBA.
What actually happened?
it is now in RGB.
What are your OS, Python and Pillow versions?
Please find the code and image to reproduce the issue on https://gist.github.com/benjaminrigaud/d98a4b54fb409bc8f745d169df0196fc
The text was updated successfully, but these errors were encountered: