How to reduce memory usage of background images?

In my application, I put PNG images in a drawable directory and used them as activity backgrounds. Since the background image usually covers the entire screen, they are large and use a lot of memory. My background images are completely opaque. Is there a way I can optimize these background images so that they can receive less memory? I heard that we can reduce the color depth of images, so they load less memory, but I don’t know how to reduce the color depth? What tool can i use?

Thank.

+5
source share
2 answers

You can try converting your drawable to a bitmap

BitmapFactory.Options ..

+1

Universal Image Loader. . RGB_565, 50% ( ) .

.bitmapConfig(Bitmap.Config.RGB_565) . RGB_565 2 , ARGB_8888.

0

All Articles