How many bits per component do you have to specify for 24-bit pngcrunch-optimized PNG files with alpha transparency?
CGBitmapContextCreate takes a parameter that isn't very obvious to me:
For example, for a 32-bit pixel format and RGB color space, you would specify 8 bits per component.
I created 24-bit PNG files with alpha transparency and added them to Xcode. At compile time, Xcode will optimize these PNG tiles using pngcrunch.
So, when trying to make a graphics context from such an image file on iPhone-OS, I need to specify a bit per component.
In this case, I would say they are 4 bits per component, although I don't know if alpha counts as a component.
0
a source to share