-1

Is it a good idea to just put a high resolution image resource in the XXHDPI or XHDPI and let android do the up scaling or down scaling according to the device on which the app runs and save time putting different size image in different folders i.e. a image for each folder LDPI,MDPI,HDPI,XHDPI,XXHDPI,XXXHDPI... means why it is required to put different images for each density when we can just use a high resoltion image for the same and let android do the rest, does it make any real difference in performance , UI or anyway ?

rd7773
  • 409
  • 3
  • 13
  • Possible duplicate of [Difference between px, dp, dip and sp on Android?](http://stackoverflow.com/questions/2025282/difference-between-px-dp-dip-and-sp-on-android) – Iamat8 Mar 22 '16 at 14:14
  • please read my question , it is in no way asking the difference between px, dp ,sp... – rd7773 Mar 22 '16 at 14:17
  • You should never UPscale, because you risk pixellation. Better DOWNscaling. However, if QUALITY (and PERFORMANCE, too) is your goal, you should provide all the scaled bitmaps. – Phantômaxx Mar 22 '16 at 14:26

2 Answers2

1

You could do that, but the downscaling is not perfect. You are going to get strange artifacts the smaller and less dense the device gets. You will get better looking apps if you design smaller assets for screen sizes that are smaller and less dense. Also photoshop or other image processing applications do a far, far better job at reducing images than the Android platform could do.

The other aspect is performance. Icons may not take a lot of time to scale individually, but there are a lot of them. Phones with smaller densities also typically are older, weaker and/or have less memory. They will feel the impact far more than newer, more powerful phones. You also run the risk of out of memory exceptions for larger images you may have like wallpapers.

DeeV
  • 35,865
  • 9
  • 108
  • 95
  • What i really want to know is , does android do the downscaling or upscaling at runtime everytime or do it just do it once when installing the app and uses those icons whenever needed , if thats the case , then i dont think There would be any performance issue , regarding artifacts , i have used only one icon for all devices and rarely see any difference btwn them on different density devices , so is it worth to spend time putting different icons for each density when same can be done with a single icon in a folder without any difference from the user's perspective. – rd7773 Mar 23 '16 at 06:10
  • @rd7773 It does it at runtime every time. – DeeV Mar 23 '16 at 11:59
0

Since API level 21, there is another way to solve the image scability in your application: Vector Drawables. They can be created from a SVG path definition.

This video is so useful in order to understand how the Vector Drawables work: https://www.youtube.com/watch?v=wlFVIIstKmA