PNG-8 Problem on Device

Be aware that Apple’s PNGCrush does more than just compress the images more. It also changes the RGBA order and removes the PNG headers. This is why you can’t display PNGs from the app after it’s been packaged. So you may find that your PNGs may not work correctly on some Apple devices or Apple could reject your app because of the PNG format. Just keep that in mind.

I would still file a bug with Apple so they can fix the issue the proper way. Wishing they would fix it won’t make it happen. [import]uid: 7559 topic_id: 31024 reply_id: 124891[/import]

I did some testing and here are the results. I was able to further reduce the file size of the PNG8 files by reducing colors. I also managed to reduce the size of PNG24 files by utilizing r.pudlowski’s Posterize tip.

PNG8: file size is reduced by 78% ( transparency isn’t as good as in PNG24, but in other ways my images look exactly like the originals.

Posterize: file size is reduced by 45% (I used posterization value 15 which is the absolute lowest I can go. I can see some reduction in image quality, but the transparency is as good as in the original)

Thanks r.pudlowski for the tip! Posterization is much better than nothing! [import]uid: 13507 topic_id: 31024 reply_id: 124689[/import]

Renamed file extensions didn’t work with Corona… Any ideas how to avoid PNGCrush of my PNG-8 files? If I can’t solve this I just have submit a 330MB app instead of a 160MB app. [import]uid: 13507 topic_id: 31024 reply_id: 124676[/import]

If you don’t mind jumping through a few hoops, you can edit the .app after Corona builds it.

All you have to do to after making the modifications you need (Re-adding your PNGs) is to call 'codesign -f -s “[Your Certificate Name Here in Quotes]” /Path/To/App.app And it’ll re-sign the app, so it’s valid for uploading. You can write a quick .sh script and use Automator on Mac to make it a Right-Click option in Finder. [import]uid: 134101 topic_id: 31024 reply_id: 124704[/import]

Sounds simple enough. This might save me. So there is no need for provisioning profile anymore at that stage? Thank you for the tip Ntero! [import]uid: 13507 topic_id: 31024 reply_id: 124828[/import]

You still need a provisioning profile, but codesign chooses the appropriate profile that matches your Certificate.

codesign is the tool used by XCode, and so it signs it in the exact same way XCode would have, but you don’t have to rebuild. Here is the Docs to give you an idea of the options available: https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/codesign.1.html

On XCode you may need an extra line, that directs codesign to an executable called codesign_allocate, but let me know if you have issues using codesign I can give a more detailed explanation (prob. end of day). [import]uid: 134101 topic_id: 31024 reply_id: 124870[/import]

Be aware that Apple’s PNGCrush does more than just compress the images more. It also changes the RGBA order and removes the PNG headers. This is why you can’t display PNGs from the app after it’s been packaged. So you may find that your PNGs may not work correctly on some Apple devices or Apple could reject your app because of the PNG format. Just keep that in mind.

I would still file a bug with Apple so they can fix the issue the proper way. Wishing they would fix it won’t make it happen. [import]uid: 7559 topic_id: 31024 reply_id: 124891[/import]