开发者

Not adding (non-retina) 1x images to an iPhone app

开发者 https://www.devze.com 2023-04-07 07:37 出处:网络
Is there a way to not add 1x images to an iPhone/iPad ap开发者_JS百科p? I\'m developing an iPhone app and also testing on my iPad.

Is there a way to not add 1x images to an iPhone/iPad ap开发者_JS百科p?

I'm developing an iPhone app and also testing on my iPad. When I just use @2x images, the iPad successfully resizes down to the 1x size.

Is there any downside to not to add 1x images? Or are they still important?


By forcing the device to downsample, you're sacrificing performance and memory for a negligible amount of disk space. It's a really bad trade-off. Plus, downsampling a larger image on the fly on the device is likely to use a lower-quality downsampling algorithm than what's available in, say, Photoshop (for performance reasons).


I had an app with 100+ near-fullscreen photos, and dropping the @1x versions made possible to keep the app below the 50 MB limit for downloading over a cellular connection.

In my case, I had no choice, but as @Kevin Ballard mentions, perhaps the trade-off is not worth it. Remember that non-retina images are 25% the size of the retina ones, so in terms of pixels you are only going from 1.25 to 1.00.

Granted, with compressed images the relation might not be linear (i.e., @1x PNG/JPEG may weight more than 1/4 of the equivalent @2x image on disk).

0

精彩评论

暂无评论...
验证码 换一张
取 消