Why are all the template images for icon in the Android developer site have resolution 72 pixels per inch under Ai and Photoshop?

雨燕双飞 提交于 2019-12-13 05:10:49

问题


The Android developer guide for icon launchers link gives the listed pixel and dpi specification for the different densities required. I downloaded the same templates for these images and in Photoshop the number of pixels for the ldpi, mdpi etc match up templates pack link. But the resolution when I check in Image -> Image Size -> gives me 72pixels/inch. I would expect that number of pixels per inch to match the dpi. How do I check the dpi or recongifure it to match the specifications of the densities for the different resource resolution sizes?


回答1:


Ignore the DPI setting, it's irrelevant in this situation. 72 DPI is just the default setting on Photoshop when you create a new document. The only thing you need to be aware of are the pixel dimensions. The DPI setting is simply an instructional marker for output such as a printer. If you tell a 640 x 480 pixel document to print at 72 DPI (dots per inch), it will print at 8.88" x 6.66". The quality will be quite terrible, though, as the resolution that a printer can produce is far superior to your display. If you tell it to print at 300 DPI, it will print at 2.13" x 1.6", but will be higher quality (the information is more densely packed, so the image will appear more continuous). The thing to keep in mind is that both prints are of the same document -- the only change being how densely placed the information is printed.

On a pixel-based screen, each pixel is mapped 1:1 with the display. If the display's DPI (how many pixels are in a 1" line on the screen -- more accurately PPI, or Pixels Per Inch) is very high, the image will just appear smaller. On a lower DPI screen, the same image will appear smaller.

This is why the developer guidelines recommend multiple versions of assets: one for xhdpi, one for hdpi, one for mdpi, and one for ldpi, with xhdpi being the largest pixel sized image, and therefore the highest quality.




回答2:


DPI - number of pixels in an inch when printed

DPI setting only controls the output size for print (eg. 96 for big print, 144 for banner, 300 for offset/highest quality)

All screens just care about the dimensions of image (width x height) as the screen resolution is 72dpi (and also 1x1px in the image = 1px on the display regarding resolution).

higher density of the screen = more pixels -> so on the same size e.g. 7" tablet with low res (e.g. 1280x800) it will be bigger than on high res 7" tablet (e.g. 2540x1600)

Quality vs Speed To keep up with quality, you will need a bigger image, to save on image sizes for all possible DPIs, but to keep better quality it is better to use larger and resize down BUT bigger image in e.g. high res mobile phones (1920x1080) will make things load slower and even reduce some performance if more effects or animations are applied to it.

Optimize think and decide what is more important, for each view reuse images for different resolutions where possible optimize well for some assets use vector based shapes if possible create different sizes for better user experience

Read about software and hardware pixels + DP sizes (images) and SP sizes (fonts)

good luck

Design info Android previously required 4 types of assets resolution: (low, medium, large, xlarge) LDPI, MDPI, HDPI, XHDPI

The default is MDPI(160dpi), that in Photoshop or when exporting from illustrator will be 72dpi. From that point when designing you would scale for other resolutions like this:

MDPI  = 100% (120dpi)
LDPI  = 75%  (160dpi)
HDPI  = 150% (240dpi)
XHDPI = 200% (320dpi)

NEWEST approach Don't do LDPI - MAKE XXDPI (300%) as resolutions are only getting better, and we tend to replace our phones quite often (more often than web browsers...)

to support the latest DPIs and super high res displays you might need also XXXDPI (400%) (nothing to do with adult industry, rather McDonald)

XXDPI  = 300% (480dpi)
XXXDPI = 400% (640dpi)

Need More? Well... go to android developer page, it is really well documented.

START HERE: developer.android.com/design



来源:https://stackoverflow.com/questions/9434671/why-are-all-the-template-images-for-icon-in-the-android-developer-site-have-reso

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!