Is it true that we have to use png images for development in iPhone and iPad. What is the advantage we would gain when using png images?
5 Answers
Apple has said that Xcode will optimize PNGs during the build process.
This article explains exactly what it is doing, and why PNGs are preferred over other formats on the iPhone. In other words, you will lose performance by using any other formats, as the conversion must be done at runtime.
http://iphonedevelopment.blogspot.com/2008/10/iphone-optimized-pngs.html

- 14,168
- 6
- 51
- 61
-
1Xcode optimization is better than using unoptimized images, but [you can do twice as well without it](http://imageoptim.com/tweetbot.html). – Kornel Mar 19 '12 at 09:56
You dont have to use png. You can use gif, jpeg, and others. If you use png, xcode will optimize them for the iOS loader (changes the byte-order of some data in the png; I'm not clear on this exactly) resulting in faster loading images.

- 39,369
- 12
- 121
- 149
This similar question goes over this: When to use PNG or JPG in iPhone development?
Pngs are a lossless format so for design, buttons, etc... for iphone/ipad what you see in photoshop (or whatever) is going to be exactly what you get as opposed to jpegs which use compressions.
That post also said that pngs use less processor to be displayed since they are uncompressed.

- 1
- 1

- 2,717
- 1
- 22
- 34
PNG supports alpha transparency (GIF only support transparent pixels, not semi-transparent) and the quality is good (not like JPEG). It also supports loseless compression.

- 15,184
- 5
- 31
- 30
@Krishnan the main advantage of using the png images is they are very light weighted......and as u know memory management is a very big issue in iphone and ipad development...thats why we use them....and for more detailed information look here
-
thats not correct, its coz they are vector images and thus they wont get pixelated when stretched. and most important thing they are not light weighted at all, in fact they are 5 times larger in size than JPEG images are. – Robin Jan 28 '11 at 04:57
-
1@robin: Wrong. PNG is a raster graphics format. It's not designed for vector images. They certainly *will* pixelate when stretched—try it in a graphics program and see. Adobe Fireworks happens to store metadata on top of a PNG format file that contains vector information, but this is *not* part of the format, and most other graphics programs do not support it. – Cody Gray - on strike Jan 28 '11 at 05:12
-
1@robin @john - you're both wrong. png's are not vector images. pngs can certainly be smaller than the equivalent jpeg for certain content. And, in general, a png and a jpg will take equivalent memory once loaded. – TomSwift Jan 28 '11 at 05:14