0

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?

Vass
  • 2,682
  • 13
  • 41
  • 60

2 Answers2

5

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.

Kevin Coppock
  • 133,643
  • 45
  • 263
  • 274
  • so for example in making an ldpi I just make a 36x36pixel image and keep it at 72ppi in photoshop/illustrator and then export to png? And for another example the xhdpi 96x96 pixels for width and height and the 72ppi again before exporting to png? Will that work? – Vass Feb 24 '12 at 17:35
  • 1
    Yup, or you can set the DPI to 6,000 if you want, it won't make a difference. :) I'd recommend starting at the largest size first, and then downscaling for the lower resolutions. – Kevin Coppock Feb 24 '12 at 18:03
  • thanks so much, maybe I understand now. You just define the number of pixels and the system then the resource with the -dpi- that is best suited for its dp...? I cannot even find the DPI in photoshop or illustrator. So I have to make the largest image first, then downscale in steps to get to the low number of pixels to be last? – Vass Feb 24 '12 at 18:33
  • 1
    More or less. But Android completely ignores the DPI setting of the image, so it doesn't even matter what it's set to; the only thing Android will check is the folder in which the drawable is located (e.g. drawables in drawable-hdpi will be used for devices defined as hdpi devices). For reference, you can adjust the DPI in Photoshop by going to Image > Image Size. In Illustrator...for the most part there IS no DPI, since it's a vector graphics program (i.e. they can be scaled to any size without quality loss). But yes, start with the largest and downscale, because that way you're starting – Kevin Coppock Feb 25 '12 at 01:24
  • 1
    with the highest quality image, and downscaling will simply discard information, whereas upscaling from a low quality image causes information to be guessed at (search "Interpolation" for more on that). Good luck. :) – Kevin Coppock Feb 25 '12 at 01:25
  • I agree with this, the default PS setting is 72 dpi which is appropriate for web use. This is the setting it will use when you try to save any new document. – Adamantus Feb 25 '12 at 17:25
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

beltrone
  • 100
  • 1
  • 1
  • 8