When I call myIndexedSurface.get_palette(), it returns a list of 32-bit RGBA values. I figured that because there is an alpha value included, I might be able to set and use palette indices with transparency effects, too. These surfaces could then be blitted as overlays or masks more efficiently than Surfaces with full-depth (32-bit) per-pixel data.
So far, though, the palette element alpha values seem locked at 255 and won't change by any method I've tried:
.set_palette_at(idx, (r,g,b,A))correctly setsr,g, andb, but leaves the alpha value at 255, regardless ofA's value..set_palette(somePalette)raisesValueError: takes an alpha value of 255if anysomePaletteRGBA tuple element has an alpha value other than 255.
Is what I'm trying to do possible? Is the alpha value in each palette-list element purely decorative, that it might be used more easily by other processes that expect 32-bit (RGBA) pixel data instead of just 24 (RGB)?
I feel like indexed surfaces in Pygame may not be equipped to handle this degree of complexity to begin with, but I also cannot think of or find a reason for why it shouldn't. Perhaps Pygame has one of its mysterious special_flags for this purpose?
I have tried initializing the Surface itself via myIndexedSurface = pygame.Surface(surfSize).convert(8) and myIndexedSurface = pygame.Surface(surfSize, flags=pygame.SRCALPHA).convert(8) to no effect.
I have not yet looked at PIL or Pygame's PixelArray for a solution.