如果我有一個包含大量圖像的 iPad 應用程序,那麼 PNG 仍然是最佳選擇嗎? (If I have an iPad app with lots of images, is PNG still the best option?)


問題描述

如果我有一個包含大量圖像的 iPad 應用程序,那麼 PNG 仍然是最佳選擇嗎? (If I have an iPad app with lots of images, is PNG still the best option?)

我正在開發一個 iPad 應用程序,它有數百張照片質量的圖像。我自然會假設將這些圖像存儲為 JPEG,以優化應用程序文件的大小。但是,Apple 的指導方針指出:

對圖像使用 PNG 格式。PNG 格式提供無損圖像內容,這意味著將圖像數據保存為 PNG 格式然後將其讀回會產生完全相同的像素值。PNG 還具有優化的存儲格式,旨在更快地讀取圖像數據。它是 iOS 的首選圖像格式。

但是,如果我以 100% 的質量存儲與 JPEG 相同的圖像,它們的大小會下降到 PNG 無損版本的一半左右。

使用 JPEG 而不是 PNG 真的會對性能造成太大影響嗎?如果我以輪播或畫廊風格查看這些圖像,我真的需要擔心性能並改用 PNG 嗎?

謝謝!


參考解法

方法 1:

Regarding the quality PNG is good for application kind of images, but JPEG is preferred for photos. Choose the lowest JPEG quality that gives good enough quality for your images.

Regarding speed, size also matters. I have no IPad to test with, but the smaller file size to read from flash or network might very well out weight any additional decompression cost. The only way to find out is to measure on your actual device.

方法 2:

There is a performance consideration but while PNG is preferred for quality, given your application, I'd suggest JPEG would be preferable.

Pure performance isn't the only factor of interest or concern; an iPad has only a finite space available to it, and filling that up with image data that most users are not going to need or want seems preferable to using more computational power for most cases.

One other thing to consider ‑ on a gallery, you are strongly recommended to generate thumbnails which give you the best of both worlds: the smaller, more accessible image for general use and the full original image for 'best'.

If in doubt, benchmark with both and see how big the difference is in your application ‑ and if the difference is something you can live with versus the space saving, go with JPEG.

(by jowieAlbin SunnanboArantor)

參考文件

  1. If I have an iPad app with lots of images, is PNG still the best option? (CC BY‑SA 3.0/4.0)

#png #performance #image-formats #jpeg #ipad






相關問題

Iphone app PNG 序列動畫 - 如何在不崩潰的情況下以最佳方式使用 OPENgle (Iphone app PNG sequence animation - How to use OPENgle optimally without crashing)

相當於PNG的視頻? (Video equivalent of PNG?)

是否有將大型 PDF 圖像存儲為文件(BMP/PNG/等)的工具或技巧? (Is there a tool or trick to store a large PDF image as a file (BMP/PNG/etc)?)

Apakah libpng memungkinkan untuk membaca tidak seluruh gambar ke memori? (Does libpng allow to read not the whole image to the memory)

如何對png文件進行去隔行掃描? (How to de-interlace png files?)

javascript PNG操作 (javascript PNG manipulation)

渲染的 PNG 的 AJAX 加載不起作用 (AJAX load of a rendered PNG not working)

性能緩慢的 WPF 動畫。使用形狀比使用 .png 更好? (Slow performance WPF animations. Better to use shapes than .png?)

Xcode 4 歸檔導致管理器緩慢/無響應,並且 pngcrush 進程佔用 100% cpu (Xcode 4 archive results in slow/unresponsive Organizer & pngcrush process takes up 100% cpu)

如果我有一個包含大量圖像的 iPad 應用程序,那麼 PNG 仍然是最佳選擇嗎? (If I have an iPad app with lots of images, is PNG still the best option?)

MKMapView 遮擋是否剔除它的註釋? (Does MKMapView occlusion cull it's annotations?)

如何在 PHP 中為透明的 PNG 文件著色? (How can I tint transparent PNG files in PHP?)







留言討論