Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Disable pngcrush in Xcode 7

Is it still possible to disable PNG compression in Xcode 7?


Prior versions of Xcode had a COMPRESS_PNG_FILES build setting in the Packaging group. That setting and its impact are described in a blog post on the ImageOptim site: https://imageoptim.com/xcode.html


However, that setting appears to be absent from Xcode 7, and adding it as a User-Defined Setting appears to make no difference.


PNGs for our application have already been optimized for file size. Xcode's pngcrush step is increasing the file size of these images, to the extent that the resulting app is no longer smaller than 100 MB. We are working to keep the app size under 100 MB so that it can be downloaded over cell networks.


We're aware that there are theoretical performance costs to disabling Xcode's PNG compression, though the reality of these costs seems to be a matter of disagreement. We're also aware that there are other alternatives to including the PNGs in the app itself.


Thanks!

Noah

Posted on Oct 5, 2015 11:19 AM

Reply
Question marked as Best reply

Posted on Oct 26, 2015 6:30 AM

After further investigation and discussion with Apple engineering, I figured out:


- the COMPRESS_PNG_FILES is still available, but it's hidden unless there's at least one PNG in the project outside of an xcassets folder

- the COMPRESS_PNG_FILES has no effect on PNGs inside xcassets folders -- they're always (de)optimized during a build, and put inside an Assets.car binary (which can be inspected withcartool)


By moving the PNGs outside of an xcassets folder and setting COMPRESS_PNG_FILES to NO, I decreased an .ipa size from 111 MB to 82 MB. I've seen no noticeable effect on performance, but we haven't done much testing yet.

1 reply
Question marked as Best reply

Oct 26, 2015 6:30 AM in response to Noah Harrison Miller

After further investigation and discussion with Apple engineering, I figured out:


- the COMPRESS_PNG_FILES is still available, but it's hidden unless there's at least one PNG in the project outside of an xcassets folder

- the COMPRESS_PNG_FILES has no effect on PNGs inside xcassets folders -- they're always (de)optimized during a build, and put inside an Assets.car binary (which can be inspected withcartool)


By moving the PNGs outside of an xcassets folder and setting COMPRESS_PNG_FILES to NO, I decreased an .ipa size from 111 MB to 82 MB. I've seen no noticeable effect on performance, but we haven't done much testing yet.

Disable pngcrush in Xcode 7

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.