本文介绍了为什么我需要@ 1x,@ 2x和@ 3x iOS图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

为什么我们需要这3种特定的图像类型?

Why do we need these 3 particular image types?

如果我的应用上有一个带有背景图片的按钮,50像素x 50像素,为什么呢?我需要这个版本的3个版本?什么阻止我制作一张高得多的图像,例如700x700,所以当它在任何iPhone上缩小时它不会低于设备所需的最大分辨率?

If I have a button on my app with a background image say, 50 pixels x 50 pixels, why do I need 3 versions of this image? What's stopping me from just making one image that's much higher in res, say, 700x700 so when it shrinks down on any iPhone it won't fall under the max res the device would want?

我唯一想到的是它只占用更多空间,但对于简单的应用程序/简单的按钮,它似乎不会引起任何问题。我在一些设备上尝试过,当我模拟它并执行此方法时,它们之间没有区别。然而,当我更深入地了解应用程序和内容时,我确信这种技术背后有实质内容。

Only thing I can think of is it just takes up more space, but for simple apps / a simple button it seems like it wouldn't cause any issues. I've tried it on a few devices and see no difference between them when I simulate it and do this method. However, as I dive more into apps and stuff I'm sure there is substance behind this technique.

推荐答案

如果你不喜欢确切的大小,有两件事情可以发生:

If you don't have the exact size, there are two things that can happen:

升级

@ 3x @ 2x 可以从 @ 1x 但通常视觉效果模糊,线条粗,看起来不太好。从 @ 2x 升级 @ 3x 可能会更糟糕,因为必须使用子像素。

@3x or @2x can be upscaled from @1x but usually the visual result is blurry, with thick lines and doesn't look good. Upscaling @3x from @2x can be even worse because subpixels must be used.

降级

一般情况下,结果比升级更好,但不适用于所有的图像。如果您在 @ 3x 图片上有 1px 边框,则将其降级为 @ 1x 边框将不可见(0.33px)。这同样适用于图像中的任何小物体。缩小范围会破坏所有细节。

In general, the results are much better than with upscaling, however, that doesn't apply for all the images. If you have a 1px border on a @3x image, after downscaling it to @1x the border won't be visible (0.33px). The same applies for any small objects in the image. Downscaling destroys all details.

一般情况下 - 为了使图像看起来更完美,您需要避免缩小和放大。您始终只能使用 @ 2x @ 3x 图像,并且只有在看到视觉问题时才添加其他比例。使用更高的分辨率不会改善降尺度。高分辨率仅用于避免升级。从大规模降级(例如 @ 100x )到 @ 1x 将不会产生比从<$缩减更好的结果c $ c> @ 3x

In general - for an image to look perfect, you want to avoid both downscaling and upscaling. You can always go with only @2x or @3x images and add other scales only if you see visual problems. Using higher resolution won't improve downscaling. High resolutions are used only to avoid upscaling. Downscaling from a high scale (e.g. @100x) to @1x won't create better results than downscaling from @3x.

这篇关于为什么我需要@ 1x,@ 2x和@ 3x iOS图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 15:37