简体   繁体   中英

What is best format to use images (png,jpg) in iOS?

I'm using a background image, and I would like it to weigh little without losing quality.

I found this option in Xcode.

Project-> Packaging -> Compress PNG Files

This would help me to improve file sizes?

The format to use images is the PNG-24 file format, since it provides the highest quality image per pixel in the lowest file size. Also, in ios development, png is favored because of the multiple formatting and optional editing.

Most importantly, PNG is a lossless compression formatt, that means it compresses images without losing any quality.

Png Supports transparency, While jpg does Not. Therefore they are favored by Apple.

PNG supports transparent background while jpg not. If you don't use a picture that need transparent background, then I think there is no significant difference between jpg and png.

As most of the others have said: for iOS development png is the preferred option.

To keep file size down, you can use PNG-8 though the transparency can get a little funny, so be careful.

JPG is a file format witch uses a real compressing method without changing the color depth. It can reduce the file size dramatically, infinitely variable, but in the same way with loss of quality. Usually JPG is recommend on photos, because of there wide color profile. A JPG with 80% compression could have a small loss of visual quality which most people don't recognize at all.

You can use the PNG 24bit for photos as well, but with bigger file size.

Additionally you can use PNG 8bit for graphics like logos or charts. There the color palette is reduced to 256 optimized/selected colors. The loss of visual quality is lower on graphics, because they already come with fewer colors.

In any case, it remains a case to decision, and yes I'm a designer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM