Hi, I’m looking to efficiently load some very large PNGs whose pixels are just black with varying levels of transparency.
It’s a waste of memory to use 32bpp for this (especially at the high resolutions involved), so I’m hoping to convert the surfaces to a max. 8bpp surface and still display the black colour with varying degrees of transparency per pixel.
I tried converting the surface to a slower bpp format but found that the resulting textures were all either solid black or solid white, with no transprency.
On iOS / UIKit, I was able to set the 8bpp images as the contents
of a CALayer’s mask, and just set the layer’s backgroundColor
to black.
I’d like to transfer this technique to SDL but I don’t really understand how SDL decides to transfer information between them, and also how to use the resultant alpha channel information as a “mask” to make semi-transparent pixels. Any help would be appreciated!