I often export PNG images from Photoshop for use in an iPhone app, using the Save For Web and Devices feature. I always leave the transparency option selected, even if there are no transparent parts to the image. This is because I assumed that it would have no effect if the image has no transparent areas, and it’s easier to just leave the option selected.
I was told recently that by doing this, the opaque property of a UIImageView is effectively ignored because the UIImage will have an alpha channel, having a negative impact on performance.
Is this correct? Should I turn off the transparency option if it’s not needed when exporting PNGs from Photoshop?
The image itself should have zero effect on a
UIImageViewor itsopaqueproperty except for the amount of image data that has to be loaded into theUIImageView‘simageproperty. Since, an image with transparency will usually have a larger amount of data than the same image without any transparency, it would take slightly longer for it to load into aUIImageView.imagewhen setting it (imageView.image = [UIImage imageNamed:@"myTransparentImage.png"];). Unless, of course, you use a different quality/compression/format/color depth/etc when exporting from Photoshop.You can verify all of this and see the exact amount of time, I/O, memory, etc for each different image by using the Instruments App with the System Usage, Time Profiler, and/or Activity Monitor templates.