6

We switched our XCode project over to use the Asset Catalog during a redesign. We needed several large background images, which we included in the asset catalog. The images were originally JPEGs that we renamed to PNGs to save space. The size of the images on disk is 19.1MB, but when we archive the app the Assets.car file that is generated is 6 times larger than that. I have tried using PNGs and compressing them, but the size is still huge. I'm not sure what else I can do.

CWitty
  • 4,488
  • 3
  • 23
  • 40
  • You say you "renamed" them to PNG. Did you just rename them, or did you actually change the format from JPG to PNG? – David Berry Mar 17 '14 at 20:28
  • Only change the extension. It works fine as far as appearance goes, it was something the designer at my work did. I believe the reason it is blowing up is because Apple converts all of the assets into one large file and doesn't know they are originally JPEGs but Im not positive. – CWitty Mar 17 '14 at 20:32
  • My guess is it's blowing up because PNG files can be substantially larger then JPG files and it's converting your JPG's to PNG because that's all you can put in an asset catalog. Try actually converting the file from JPG to PNG and see what the size difference is. – David Berry Mar 17 '14 at 20:40
  • I tried that as well and it made no difference. I also ran ImagOptim with no success. – CWitty Mar 17 '14 at 20:41

2 Answers2

8

It turns out that any image no matter what the original format is converted into a png during the archiving process. I moved the images to the old format of using images and the app size returned to normal.

CWitty
  • 4,488
  • 3
  • 23
  • 40
  • 1
    Good news: This doesn't seem to be the case with Xcode 7 (I didn't test it with 6) anymore. I tested and compiled for iOS 8 / 9 and the resulting car file for the asset catalogs has pretty much the same size as the included JPGs. If it was still converted to PNG, it would definitely be much larger. – wolfrevo Sep 13 '15 at 13:53
0

Xcode "compresses" PNG files by default when building project. So if your JPEGs are renamed as .png, they will be converted to real PNGs then compressed.

This behaviour can be disabled. Just change Compress PNG Files option to NO in project build settings.

Quotation
  • 711
  • 8
  • 12