How to make different versions of an image for different screen densities?

Asked

Viewed 239 times

0

I have an image that will be placed inside my app (just an example), how can I make a version hdpi, xhdpi, xxhdpi, etc of it? I know I should put in the respective folders, but when I only have one image how can I make these different versions?

  • 2

    Use an image editor (Photoshop) that allows you to resize them. See in this reply the size relations to use. If icons use Image/Vector Asset android Studio.

  • 1

    There’s always the GIMP as an open source alternative in the image editing area

  • I used the same GIMP, Isac, it worked here. By the way, @ramaral, if you want to answer I can mark as answered.

  • 1

    I think it’s best to consider it duplicate.

1 answer

2

Do the download a program called Resizer, it is a . jar that resizes the images for you to the sizes of Android. Usually we generate the image with the largest size xxxhdi and resize to smaller sizes, this prevents distortion.

But the best option is to generate vector images and using Android Studio > Vector Asset. It generates for you Xmls with the image dimensions for all sizes. This causes you to decrease the size of your project.

  • I already managed to do with what the extension indicated, but I will test the tool also

Browser other questions tagged

You are not signed in. Login or sign up in order to post.