Quote:Original post by Iori Branford PNG transparency is color-key-based
I am sure PNG transparency is done through an 8-bit alpha channel. Although some png images may not include an alpha-channel(no transparency), that is rare.
You can blit an image with an alpha-channel using a colorkey if SDL_SRCALPHA is NOT set. But if SDL_SRCALPHA is not set, then you cannot use per-surface or per-pixel alpha, only the colorkey.
It is true that colorkey and per-surface alpha can be used together. But if a surface has an alpha-channel and SDL_SRCALPHA is set, then both colorkey and per-surface alpha will be ignore.
An SDL surface has an alpha-channel if (surface->format->Amask != 0) is true.
See the description of
SDL_BlitSurface and specifically the psuedocode segment to see how per-surface,per-pixel alpha, and colorkeying works and doesn't work together.
PNG reference,see Colour depths.