joepetrakovich
joepetrakovich

Reputation: 1366

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

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

Upvotes: 3

Views: 2515

Answers (2)

bigstones
bigstones

Reputation: 15267

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.

Upvotes: 6

Mohit Deshpande
Mohit Deshpande

Reputation: 55227

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

Upvotes: 2

Related Questions