Is it enough to provide a 3x image only for all versions on the iPhone?

Is it not enough for an image with a resolution of 3 times (for example, for presentation or a button) in Xcode to look good on iPhone 5,6 and 6plus devices (i.e. leaving 1x and 2x in the image blank)

My reasoning is that a 1x image may look blurry at 6 plus, but a 3x image should look normal at 5

Basically I ask that I can communicate the same thing with my graphic designer, and he should be ok with providing a size for one size, not three sizes for all images

+6
source share
2 answers

This has been asked and answered 2x assets many times, and the answer hasn't really changed (but it's hard to keep track of repeating questions when I send from my phone).

If you send assets with a higher scaling factor than the target device, they will be displayed just fine. But their real-time scaling has a performance cost — they use more memory, they need more time to load onto the GPU, they take the GPU time to render. Some of these costs are trivial, others are not. (Remember, a 2x image is 4x of 1x data and a 3x image is 2.25x of 2x data.) And they add up for every image in your application.

Most importantly, devices with a lower scaling factor are those that have less CPU / GPU / memory resources spent on scaling.

So what to do? Well, if you do not want your artist to deal with several large-scale factors, just order a 3-fold work and draw it yourself in Photoshop (or heck, even Preview) before sending. It may not seem as pleasant as if your artist had adjusted it for each size, but it would look as good as real-time scaling, without spending any runtime.

Or, with Xcode 6, you can put the PDF into your asset directory, and Xcode automatically generates PNG for each size at build time. (This is a feature of Xcode, not iOS, so it works even if you focus on iOS 7.)

+8
source

The problem with this idea is that in iOS 8 the iphone 4S is still supported and has a different image format than every other iPhone. It displays 320x480 by 2x, so creating images in accordance with this will not look grainy. The remaining 3 screen sizes will work if you go in with a 3x scale, which will be 1920x1080 for each page and just reduce the size for 4in and 4.7in screens. Most likely, you will need 2 message boards for the application (one for 3.5in and then another for 3 other screen sizes). In this case, automatic calibration will not work if you did not modify the UIImage image because it would have a shorter length while maintaining the same width.

EDIT: iPhone 6+ screen size has been changed to accommodate scaling down 1.15x and changed the rendering coefficient according to the comment below

0
source

Source: https://habr.com/ru/post/977975/


All Articles