skip to Main Content

I’ve read the posts but I still do not understand how to convert my image to dpi.

I have a 2689x1900px image. I have created the drawable-hdpi, mdpi, xhdpi, xxhdpi and xxxhdpi folders.
I know that I need to insert the images there (same name) but I don’t know to what pixel size do I need to convert. I’m using photoshop.

Can someone please explain the process of scaling and use my example (2689×1900) ?

2

Answers


  1. Let’s assume that 2689×1900 is your 100% image, the biggest one. The biggest density is xxxhdpi. So, xxxhdpi is a 100% density.

    Next, we need to calculate the smaller sizes:

    • xxhdpi is 75% of xxxhdpi, so it is 0.75 * (2689×1900);
    • xhdpi is 50% of xxxhdpi, so it is 0.5 * (2689×1900);
    • hdpi is 37.5% of xxxhdpi, so it is 0.375 * (2689×1900);
    • mdpi is 25% of xxxhdpi, so it is 0.25 * (2689×1900)

    You can find more on that topic in Supporting Multiple Screens.

    Note though that your image size slightly differs from the mostly used xxxhdpi screen resolution, 2560×1920, and you may want to adjust the size before scaling so that the images will fit perfectly into different screen resolutions.

    Login or Signup to reply.
  2. first of all, reducing the size of the image in photoshop can cause pixellations. i suggest you to use inkscape or any other vector graphics editor.

    then for full screen image
    mdpi – 1 (360×640)
    hdpi – 1.5 (540×960)
    xhdpi – 2 (720×1280)
    xxhdpi – 3 (1080×1920)
    xxxhdpi – 4 (1440×2560)
    these are the ideal sizes of the image.
    the integers represent the scaling factor. if you want to maintain the aspect ratio of the image, then select the nearest image folder and scale.it using this factor.

    more details here https://developer.android.com/training/multiscreen/screendensities.html#TaskProvideAltBmp

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search