Skip to content

Improve converting images with transparency to PA - #10421

Merged
radarhere merged 2 commits into
python-pillow:mainfrom
qodelicious:fix-convert-transparency-to-pa
Nov 6, 2026
Merged

radarhere merged 2 commits into
python-pillow:mainfrom
qodelicious:fix-convert-transparency-to-pa

Conversation

@qodelicious

Copy link
Copy Markdown
Contributor

Changes proposed in this pull request:

  • Converting a 1, L, I, I;16 or RGB image with transparency to PA ignored it. The alpha channel stayed fully opaque and the old transparency value was left in info.
  • The transparency is now used for the alpha channel, the same as converting to LA or RGBA. The palette part is converted as before.

@akx

akx commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Does this relate to my #9833?

@qodelicious

Copy link
Copy Markdown
Contributor Author

Not really, #9833 was about saving PA images as PNG. This one is about convert() to PA, where the transparency from 1, L, RGB etc was ignored and the alpha came out fully opaque. They'd go together nicely though, since you could then save the converted image

@akx

akx commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

#9833's comments had some discussion that may be pertinent here though :)

@radarhere radarhere changed the title Fix converting images with transparency to PA Improve converting images with transparency to PA Nov 6, 2026
@radarhere

Copy link
Copy Markdown
Member

I'm also unsure what akx is referring to - his PR converted PA to P, but this is converting to PA, not from?

@radarhere
radarhere merged commit 6f2f047 into python-pillow:main Nov 6, 2026
69 of 72 checks passed
@radarhere radarhere added the 🤖-assisted AI-assisted label Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants