Android Image Compression Quality parameters
In the utility Imageloader, when configuring displayimageoptions, you need to set the. Bitmapconfig (Bitmap.Config.RGB_565)
So what does this Bitmap.Config.RGB_565 mean?
Large pictures in Android generally have to be compressed to display, otherwise prone to oom, generally we compress only attention to its size, in fact, in addition to the size, the impact of a picture occupies space and its color details .
Open the Android.graphics.Bitmap class has an inner class Bitmap.config class, in the Bitmap class CreateBitmap (intwidth, int height , Bitmap.config Config) method will be used, open a look at this class
Enumeration variables
public static final Bitmap.config alpha_8public static final bitmap.config argb_4444public static final Bitmap.config ARGB _8888public Static Final Bitmap.config rgb_565
It's kind of covered.Alpha_8argb_4444argb_8888rgb_565What is it?
In fact, this is the color of the storage method: We know that ARGB refers to a color pattern, where a for Alpha, R for Red, G for Green, b for Blue , in fact , all the visible color is the right red and green blue, so red and green blue is also known as the three primary colors, each primary color is stored the value of the information expressed
To be blunt is actually:
Alpha_8 is that Alpha is made up of 8 bits .
argb_4444 is made up of 4 4-bit, or 16-bit,
argb_8888 is made up of 4 8-bit, or 32-bit,
rgb_565 is R is 5 bits, G is 6 bits, B is 5 bits total 16 bits
Thus:
Alpha_8 represents a 8-bit alpha bitmap
argb_4444 represents a 16-bit ARGB bitmap
argb_8888 represents a 32-bit ARGB bitmap
rgb_565 represents a 8-bit RGB bitmap
The higher the number of bitmap bits, the more color information they can store, and the more realistic the image will be.
Usage:
Set the value of option before compressing:
Options.inpreferredconfig = Bitmap.Config.RGB_565;
Android picture Compression quality parameters Bitmap.config rgb_565 and so on meaning