iosiphonexcodeiphone-5iphone-6

Is it sufficient to supply 3x image only for all versions on iPhone?


is it not enough to supply just 3x resolution image (e.g for a view or button) in Xcode so that it looks good on iPhone 5,6,and 6plus devices ( i.e leaving 1x and 2x in an image set blank )

My reasoning is that 1x image may look blurry on 6 plus but 3x image should look fine on 5

Basically i am asking so that i can communicate the same to my graphic designer and he should be fine with supplying a singe size rather than three sizes for all images


Solution

  • This got asked and answered many times regarding 2x assets, and the answer hasn't really changed (but it's hard to track down duplicate questions when I'm posting from my phone).

    If you ship assets with a higher scale factor than the target device, they will display just fine. But downscaling them in real time has performance costs—they use more memory, they take longer to upload to the GPU, they take GPU time to render. Some of these costs are trivial, others aren't. (Remember, a 2x image is 4x the data of a 1x one, and a 3x image is 2.25x the data of a 2x one.) And they add up for every image in your app.

    Most importantly, the devices with lower scale factors are the ones with less CPU/GPU/memory resources to spend on downscaling.

    So, what to do? Well, if you don't want to have your artist deal with multiple scale factors, just order the 3x artwork and scale it yourself in Photoshop (or heck, even Preview) before you ship. It might not look as nice as if your artist tweaked it for each size, but it'll look about as good as real-time scaling without the run-time performance costs.

    Or, with Xcode 6, you can put a PDF in your asset catalog, and Xcode will automatically generate PNGs for each size at build time. (This is an Xcode feature, not an iOS one, so it works even if you're targeting iOS 7.)