JPG image becomes dark

JPG image becomes dark
0.0 0


Hello everyone,

I use JPG image as background image in my game to reduce size.
It’s working fine in >iOS 5. But in iOS 4.3.3 it become dark as shown in the attached image.
It will be great if anyone can explain exactly why this problem can be occurred and how it can be resolved.


iOS 4.3.3.PNG (189.7 KB)

_iOS 5.PNG (862.4 KB)


you can find cocos2dx/platform/ios/ , and replace

pImageinfo~~>hasAlpha =
|| ;
pImageinfo~~>hasAlpha = ((info kCGImageAlphaNoneSkipLast) || (info kCGImageAlphaPremultipliedLast) || (info kCGImageAlphaPremultipliedFirst) || (info kCGImageAlphaLast) || (info == kCGImageAlphaFirst) ? YES : NO);


It works. Thanks.
I am also informed that it takes much longer times to load JPG than PNG. So I think anyone should rethink before using it instead of PNG.


We ran into this bug and submitted (suggested) fix in a pull request :
Please consider merging it to master, 4.3 support is still something important to keep when possible IMHO


It is merged.
Thank you.