Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you prepare an image for a smaller density screen?

Tags:

android

image

I initially built an Android app and threw all of my images in the drawable-hdpi resource directory and now I'm going back and making the necessary changes/additions so that the app is supported on all screen sizes and densities.

How do I go about taking all of my images and making them 'less dense'? My first guess is to load them into Gimp or Photoshop and scale them down to a smaller resolution. Is this all I need to do? enter image description here

like image 955
joepetrakovich Avatar asked Nov 24 '25 13:11

joepetrakovich


2 Answers

How do I go about taking all of my images and making them 'less dense'? My first guess is to load them into Gimp or Photoshop and scale them down to a smaller resolution. Is this all I need to do?

Yes, that's all. The scaling performed by such programs is way better looking than Android's automatic scaling.

The dpi values are:

  • ldpi = 120 dpi
  • mdpi = 160 dpi
  • hdpi = 240 dpi

so if you have hdpi images you can scale them to 66% and obtain mdpi images, or 50% to get ldpi images.

like image 119
bigstones Avatar answered Nov 26 '25 23:11

bigstones


Check out the docs about adapting your image to different screen sizes and densities. Also check out the UI Guidlines for icons and such. It gives you exact pixel width by height of an image in the different screen densities. This gives EXACT pixel densities. You have to scale down your image and put it in a different folder in your res directory, in your case: put it in the drawable-ldpi folder in res

like image 23
Mohit Deshpande Avatar answered Nov 26 '25 22:11

Mohit Deshpande



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!