简体   繁体   English

图像大小和移动设备和dpi

[英]Image sizes and mobile devices and the dpi

This is a question regarding images and their sizes for mobile devices. 这是关于移动设备的图像及其大小的问题。

So assume I want an image for the full mobile screen. 所以假设我想要一个完整的移动屏幕的图像。 I am assuming that the screen is 320*480 here, which seems consistent. 我假设这里的屏幕是320 * 480,这似乎是一致的。

When I make the image in Photoshop or MS Paint or whatever, I can choose the pixels/inch (ok, maybe not in paint, but you get my drift). 当我在Photoshop或MS Paint或其他任何地方制作图像时,我可以选择像素/英寸(好吧,也许不是在油漆中,但你得到我的漂移)。 The default is 72 pixels/inch, is this to be maintained at all times? 默认为72像素/英寸,这是否始终保持?

Some devices have a higher dpi - I think the "default" is 160 dpi - so for a device which is, say, 240dpi, to show my same image do I: 有些设备的dpi较高 - 我认为“默认”是160 dpi - 所以对于一个240dpi的设备来说,我可以显示相同的图像:

  1. Scale the image up from 320*480 to 480 * 640 (ie size = oldSize*240/160) Or 将图像从320 * 480缩放到480 * 640(即size = oldSize * 240/160)或
  2. Go to my image and change the pixel/inch to 72 * 240/160? 转到我的图像并将像素/英寸更改为72 * 240/160?

Given that Android has sizes like so: 鉴于Android的大小如下:

xlarge screens are at least 960dp x 720dp
large screens are at least 640dp x 480dp
normal screens are at least 470dp x 320dp
small screens are at least 426dp x 320dp

(From this http://developer.android.com/guide/practices/screens_support.html ) (来自此http://developer.android.com/guide/practices/screens_support.html

I take it that by scaling my images up/down and shuffling them to the right location I can get cross-device compatability. 我认为通过向上/向下缩放图像并将它们拖放到正确的位置,我可以获得跨设备的兼容性。

Next, instead of increasing image sizes, is it better to just make a really big image and shrink it as needed? 接下来,不是增加图像尺寸,最好是制作一个非常大的图像并根据需要缩小它?

For iPads and iPhones, it is the exact same question, just different numbers! 对于iPad和iPhone,这是完全相同的问题,只是不同的数字! The phones are 320x480 and Retina is 640x960, the iPad is 1024x768 and Retina is, again, four times as large. 手机为320x480,Retina为640x960,iPad为1024x768,Retina为4倍。

So do the images scale up or the pixels/inch in Photoshop scale up? 那么图像放大还是Photoshop中的像素/英寸可以放大?

I guess in the end I am asking: 我想最后我要问:
What is the recommended pixels/inch in Photoshop for an image? Photoshop中图像的推荐像素/英寸是多少?
Does this number change, or the image size change? 此数字是否更改,或图像大小是否更改?
Assuming images for an Android, should the image size in the h,m,l folders be the minimum of the value in the Android specs, or just under the maximum? 假设Android的图像,h,m,l文件夹中的图像大小是否应该是Android规格中的最小值,或者仅低于最大值?

The bitmap requirement is similar to preparing graphics for print vs. the Web. 位图要求类似于为打印与Web准备图形。 If you have any experience with print production, you'll know that a 72 PPI image will look very pixelated and blurry when scaled up and printed. 如果您对打印制作有任何经验,您将会知道在放大和打印时,72 PPI图像看起来会非常像素化并且模糊不清。 Instead, you would need to redo the image as a vector image or use a high-resolution photo and then set the file's resolution at around 300 PPI in order to print it without any loss of image quality. 相反,您需要将图像重做为矢量图像或使用高分辨率照片,然后将文件的分辨率设置为约300 PPI,以便在不损失图像质量的情况下进行打印。 Screen density for Android works similar, except that we're not changing the file's resolution, only the image's size (ie standard 72 PPI is fine). Android的屏幕密度类似,只是我们没有更改文件的分辨率,只有图像的大小(即标准72 PPI很好)。

Don't increase any resolution in photoshop or gimp for changing your image keep 72ppi only. 不要在photoshop或gimp中增加任何分辨率以更改图像,仅保留72ppi。

just scale the image from baseline ie mdpi=1. 只是从基线缩放图像,即mdpi = 1。

75 × 75 for low-density screens (i.e. ×0.75); 
100 × 100 for medium-density screens (our baseline);
133 x 133 fpr TVDPI (1.33)(no need to supply graphics android will auto scale from hdpi) 213/160=1.33125
150 × 150 for high-density screens (×1.5);
200 × 200 for extra high-density screens (×2.0). 

I also found this interesting discussion on the whole "ppi" question: 我还在整个“ppi”问题上找到了这个有趣的讨论:

The Myth of dpi , which posits that the "ppi" is an inherently bad question, because a 300 px * 100 px image at 72 dpi has the same pixels as a 300 px * 100 px at 144dpi. dpi的神话 ,假设“ppi”是一个固有的坏问题,因为72 dpi的300 px * 100 px图像与144 dpi的300 px * 100 px具有相同的像素。

So when designing for the web, setting the pixel size appropriately is all that is important - dpi can be 144 or 1 or one billion, it won't affect how the computer displays the image. 因此,在设计网络时,正确设置像素大小非常重要--dpi可以是144或1或10亿,它不会影响计算机显示图像的方式。

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

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