Skip to content
Discussion options

You must be logged in to vote

I think this comes back to the same distinction as #9242 - PA images store a palette index and an independent alpha value for each pixel.

Your highlighted quote says, emphasis mine,

an optional list of 8-bit alpha values for the palette entries

What I think your highlighted quote is describing is P mode image with an RGBA palette, where the alpha values are for the palette entries, not for the pixel values. So if I had a palette with only two entries, (255, 0, 0, 127) and (0, 255, 0, 255), I must choose between translucent red and opaque green. With just those entries, I can't have opaque red.

That type of image can be saved as a PNG image with Pillow.

from PIL import Image
import numpy as

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pekkavaa
Comment options

Answer selected by radarhere
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants