Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android image size (portrait only) for mdpi, hdpi, xhdpi, xxhdpi

I currently work on an android project that the app is force to portrait only, I already have some design pictures and I would like to cut the image to build the UI. However, the problem is how should I scale each picture?

What I found so far

xlarge (xhdpi): 640x960
large (hdpi): 480x800
medium (mdpi): 320x480
small (ldpi): 240x320

But I also found

hdpi = mdpi * 1.5
xhdpi = mdpi * 2
xxhdpi = mdpi *3

but actually the mdpi * 1.5 should be 480 * 720 ? How should I resize the picture for each resolution? thanks

like image 812
user3538235 Avatar asked Apr 22 '14 01:04

user3538235


1 Answers

Those resolutions are only guidelines not absolutes, and represent a general amount of pixels in each dpi "bucket". I'd primarily use the scaling factors instead. So whatever your image's resolution, scale appropriately. For instance, my raw image files are always designed as the xxhdpi version. Then I scale down by 3, 2, and 1.5 for the lower dpi versions.

like image 181
Jay Soyer Avatar answered Sep 27 '22 18:09

Jay Soyer