11

In XCode 4 when working on an iOS project (maybe it was in XCode 3 too and I just hadn't noticed it) there is field under build settings called "Combine High Resolution Artwork", which can be set to yes or no.

What exactly does this setting do?

guy
  • 587
  • 4
  • 13

1 Answers1

25

From Xcode's quick help:

Combine High Resolution Artwork COMBINE_HIDPI_IMAGES

Combines image files at different resolutions into one multi-page TIFF file that is HiDPI compliant for Mac OS X 10.7 and later. Only image files in the same directory and with the same base name and extension are combined. The file names must conform to the naming convention used in HiDPI. [COMBINE_HIDPI_IMAGES]

In other words, the setting probably has no effect under iOS at the moment. It would combine abc.png and abc@2x.png into one multi-page TIFF file, which would be convenient under OS X because NSImage can handle such files and use the image representation that is best suited for the desired output size and device. If future Apple hardware will have higher screen resolutions, this setting will probably play an important role in how developers deal with it.

Community
  • 1
  • 1
Ole Begemann
  • 135,006
  • 31
  • 278
  • 256
  • 8
    Using that setting will convert your PNGs into TIFFs, so be careful when using [NSBundle mainBundle] pathForResource:@"... png"]. – Sani Aug 10 '12 at 09:22
  • 5
    Thanks to Ole for this tip. I am using static libs + extra resource bundles for an iOS project and this COMBINE_HIDPI_IMAGES was set to YES which caused the NIBs referencing PNG files to fail loading. Looking in the compiled output confirmed that TIFFs were being created. Changed the setting to no for all extra bundles and it works like normal. – André Jacobs Aug 24 '12 at 12:34
  • @AndréJacobs Wow, that is very annoying. – Tom Redman Jun 24 '13 at 21:47
  • Beware that this will increase image file sizes by 40% compared to PNG. These TIFFs support only LZW compression, which is same as in GIF, and not very well suited for true-color images. – Kornel Sep 06 '13 at 21:12