iPhone 图像资源、ICO 与 PNG、应用程序包文件大小
我的应用程序收集了大约 1940 个图标,并在整个应用程序中使用。
它们目前处于 ICO 状态,提供给我的新图像也采用 ICO 格式。我注意到它们在一个文件中包含每个图标的 16x16 和 32x32 表示形式。
每个文件的文件大小大约为 4KB(根据 finder 的报告,但 ls
报告称它们的大小从大约 1000 字节到 5000 字节不等)。
这些图标中的极少数仅包含 32x32 表示形式,并且如下所示:结果只有大约 700 字节大小。
目前,我将这些图标与我的应用程序捆绑在一起,它们使应用程序的大小比我想要的要大一些。
这些图像总共只有约 25.5MB。 Xcode 必须进行某种压缩,因为生成的应用程序包大约为 12.4MB。将其进一步压缩为 ZIP(就像提交到 App Store 时一样),最终文件大小为 5.8MB。
我知道自 iPad 推出以来,App Store 无线下载的最大限制已提高至 20MB(我不确定这是否会扩展到 iPhone 应用程序以及 iPad 应用程序,如果不是的话,该限制将为 10MB)。
我担心的是,将会添加新图标(有时每周最多 10 个图标),并且随着时间的推移,应用程序包将继续膨胀。
在我的应用程序中分发这些图标的最佳方式是什么?
我尝试过但没有取得多大成功的事情:
- 将图标从 ICO 转换为 PNG:
- 我尝试这样做是希望 pngcrush 实用程序能够帮助解决文件大小问题。但看起来它在普通 PNG 和压缩 PNG 之间没有太大区别(我相信它只是优化图像以在 iPhone 的 GPU 上显示,而不是压缩其大小)。另外,从 ICO 到 PNG 实际上增加了图标文件的大小......
- 压缩图像,然后在第一次运行时解压缩它们。
- 虽然这确实减少了整体图像大小,但我发现解压缩它们、将它们复制到文档文件夹并确保升级时不会发生重复所需的工作量太大,不值得这样做。此外,在原始 iPhone 和 3G iPhone 上解压和复制大约 25MB 的图像需要很长时间,并且会造成糟糕的体验......
我考虑过但尚未尝试过的事情:
- 不要在应用程序包中分发图标,而是在线托管它们,并且按需下载每个图标(这取决于用户关于实际显示哪些图标以及何时显示的数据)。
- 问题是带宽需要花钱,而且图像下载会占用大量带宽。不过,我的应用目前拥有约 5,500 名用户(根据 Flurry 统计数据,我估计其中约有 1500 名活跃用户),而且我当前的托管包有大量未使用的带宽限额。
因此,我对如何解决这个棘手问题持开放态度。
My application has a collection of around 1940 icons that are used throughout.
They're currently in ICO and new images provided to me come in ICO format too. I have noticed that they contain a 16x16 and 32x32 representation of each icon in one file.
Each file is roughly 4KB in filesize (as reported by finder, but ls
reports that they vary from being ~1000 bytes to 5000 bytes)
A very small number of these icons only contain the 32x32 representation, and as a result are only around 700 bytes in size.
Currently I am bundling these icons with my application and they are inflating the size of the app a bit more than I would like.
Altogether, the images total just about 25.5MB. Xcode must do some kind of compression because the resulting app bundle is about 12.4MB. Compressing this further into a ZIP (as it would be when submitted to the App Store), results in a final file of 5.8MB.
I'm aware that the maximum limit for over the air App Store downloads has been raised to 20MB since the introduction of the iPad (I'm not sure if that extends to iPhone apps as well as iPad apps though, if not the limit would be 10MB).
My worry is that new icons are going to be added (sometimes up to 10 icons per week), and will continue to inflate the app bundle over time.
What is the best way to distribute these icons with my app?
Things I've tried and not had much success with:
- Converting the icons from ICO to PNG:
- I tried this in the hopes that the pngcrush utility would help out with the filesize. But it appears that it doesn't make much of a difference between a normal PNG and a crushed png (I believe it just optimises the image for display on the iPhone's GPU rather than compress it's size). Also in going from ICO to PNG actually increased the size of the icon file...
- Zipping the images, and then uncompressing them on first run.
- While this did reduce the overall image sizes, I found that the effort needed to unzip them, copy them to the documents folder and ensure that duplication doesn't happen on upgrades was too much hassle to be worth the benefit. Also, on original and 3G iPhones unzipping and copying around 25MB of images takes too long and creates a bad experience...
Things I've considered but not yet tried:
- Instead of distributing the icons within the app bundle, host them online, and download each icon on demand (it depends on the user's data as to which icons will actually be displayed and when).
- Issues with this is that bandwidth costs money, and image downloads will be bandwidth intensive. However, my app currently has a small userbase of around 5,500 users (of which I estimate around 1500 to be active based on Flurry stats), and I have a huge unused bandwidth allowance with my current hosting package.
So I'm open to thoughts on how to solve this tricky issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我为客户做了一些关于 MonoTouch 的研究。 MonoTouch 的最小文件大小为 5.1mb,因为所有都是 C# 内容。这似乎并没有影响应用程序商店用户下载基于 MonoTouch 的应用程序的意愿。
在我的研究中,我没有看到任何证据表明最终用户在做出购买决定时非常关注应用程序的大小。许多应用程序首先通过 iTunes 下载到非手机上,1mb 和 5mb 之间的下载时间差异几乎不明显。许多最终用户只是模糊地意识到应用程序甚至有大小。
我的建议是尝试根据使用率确定图标的优先级。 Praeto 规则 出现在大多数数据中,因此您可能会发现 20% 的图标得到80%的使用率。将 20% 最活跃的图标包含在应用程序包中,然后下载其余图标。
I did some research on MonoTouch for a client. MonoTouch has a minimum file size of 5.1mb because all the C# stuff. It doesn't seem to have affected apps store users willingness to download the MonoTouch based apps.
In my research I didn't see any evidence that end users pay much attention to app size when making purchasing decisions. A lot of apps are first downloaded to non-Mobiles via iTunes and the difference in download time between a 1mb and 5mb is barely noticeable. A lot of end users are only vaguely aware that apps even have a size.
My recommendation would be to try and prioritize the icons based on usage rate. Praeto's rule shows up in most data so you'll probably find that 20% of the icons get 80% of the use. Include that 20% most active icons in the app bundle and then download the rest.