简体   繁体   English

iOS理想的图像分辨率

[英]iOS ideal image resolution

I'm having a real hard time understanding this, but let's say I have an iOS app for both iPad and iPhone and I want to download an image from a server and display it in full screen. 我很难理解这一点,但是,我有一个适用于iPad和iPhone的iOS应用程序,我想从服务器下载图像并全屏显示。

I have read that the iPad pro has a resolution of 2732x2048 and if we want to display an image in fullscreen we would need to download the image with this size right? 我已经读过iPad Pro的分辨率为2732x2048 ,如果我们要全屏显示图像,我们需要下载这个尺寸的图像对吗? However, I also read that the image should never be over 300KB. 但是,我还读到该映像永远不应超过300KB。 I was not able to bring an image with this size under 2MB (I used JPEGmini for example to reduce size). 我无法将这个大小的图片带到2MB以下(例如,我使用JPEGmini来减小大小)。

And I don't think that iPhone user would need to download such a huge image, so my question is: what resolution should my images be on the server and how can I manage to keep them in a rational file size. 而且我认为iPhone用户不需要下载这么大的图像,所以我的问题是:我的图像应该在服务器上具有什么分辨率,以及如何设法将它们保持在合理的文件大小内。 Also should I upload multiple images for different devices? 我还应该为不同的设备上传多张图片吗? If so, how many and at what resolutions? 如果是这样,请问有多少,以什么分辨率?

Isn't the problem merely that you are holding incompatible beliefs? 难道不仅仅是您持有不相容的信念? This is the belief that is giving you trouble: 这是给您带来麻烦的信念:

I also read that the image should never be over 300KB. 我还读到该图像永远不会超过300KB。

Let go of it. 放开它

Clearly it is right to say that the image should be no larger than needed for display. 显然,应该说图像不应该大于显示所需的大小。 But an image to be shown as a 3x scale image on the iPad pro needs to be 2732x2048. 但是要在iPad Pro上显示为3倍比例图像的图像必须为2732x2048。 So that's that. 就是这样。

(You could, alternatively, use an image 2/3 of that size and show it as a 2x scale image. It wouldn't look quite as good as the 3x scale image, but it might be acceptable.) (或者,您可以使用该大小的2/3的图像,并将其显示为2倍比例的图像。虽然看起来不如3倍比例的图像好,但是可以接受。)

On a smaller device, yes, you should scale down the image in code, so that you are not holding in memory an image larger than needed for display. 是的,在较小的设备上,您应该按代码缩小图像,以使您不会在内存中保留大于显示所需的图像。 But in this case, you need the large image for display. 但是在这种情况下,您需要显示大图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM