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

2

14

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

Czernowitz answered 10/11, 2014 at 11:53 Comment(3)
I don't understand this reason: if you supply 1x, 2x and 3x at least 2x is going to be used by newer iPhones. It might be convenient if we were able to provide only 3x and let Xcode downscale it automatically, but I personally don't see it as a needed feature yet. Note that the App Store apps can't be limited to iPhone 5+ at the moment. Anyway, you can quickly create an utility for your designer or for yourself to copy-scale (and rename if needed) all the images if that is the only issue.Discussion
I'm sure you should not supply any @1x image if your application dopes not run on non-retina iPads. there is no non-retina iPhone supported since iOS7.Pinzler
@Fogmeister, in iOS7+: 1. there is no non-retina iPod Touch supported; 2. the iPhone4S has a retina display, 3. the non-retina iPads runs the iPhone apps in retina-mode, and you cannot scale down – therefore: for an iPhone app in iOS7+, the @1x images completely can be ignored.Pinzler
E
16

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.)

Electrograph answered 10/11, 2014 at 15:49 Comment(0)
H
1

The problem with this idea is that in iOS 8 the iphone 4S is still supported and it has a different aspect ratio than every other iPhone. It renders at 320x480 at 2x so creating images to fit this wouldn't look grainy. The other 3 screen sizes would work if you go with the 3x scale which would be 1920x1080 for every page and just downscale the size for the 4in and 4.7in screens. You will likely need 2 story boards for the app (one for 3.5in and then the other for the 3 other screen sizes). Auto-sizing wouldn't really work in this case unless you changed the image of the UIImage because it would have a shortened length while maintaining the same width.

EDIT: changed the iPhone 6+ screen size to account for the 1.15x down scaling and changed the rendering factor to match the comment below

Heater answered 10/11, 2014 at 14:37 Comment(1)
iPhone 4s is a 2x Retina display, not 1x. The last non-Retina iPhone is the 3GS, unsupported as of iOS 7.Electrograph

© 2022 - 2024 — McMap. All rights reserved.