My app uses a lot of PNG textures that in total take up more than 20MB. I used the tool “ImageOptim” (which internally just calls pngout and pngcrush) to make the files smaller. The new textures work well on iPhone, but on Android many of them either cause a crash or display with “bands”, white lines running across the texture.
The possible causes I can think of are:
- Android aapt is compressing the images again and causing the problem.
- pngcrush or pngout are removing important headers that are required by libpng but not by iOS.
Are any of these solutions possible?
- Is there a way to read images from res/raw in cocos2d-x? This would avoid the re-compression.
- Can I load a PNG image from a file with a different extension, like MP3? This would avoid the re-compression too.
- Is there a way to manually specify the width and height of a PNG image when loading it, rather than attempting to read the headers as CCImageCommon_cpp.h does? Most of my textures are of a known POT size.