Could someone explain what is really happening when setting inDither = true in the context of configarating a bitmap in Android?
At Developer.Android one can read about the static variable
Config.RGB_565
This configuration can produce slight visual artifacts depending on the configuration of the source. For instance, without dithering, the result might show a greenish tint. To get better results dithering should be applied
I had this problem until I followed this recommendation, that is:
options.inPreferredConfig = Config.RGB_565;
options.inDither = true;
So my question: how do one understand inDither in Android. Its one thing to know when to use a syntax ... another to fully understand it.
Thanks in advance!
When you are running low on the number of colors supported , then moving from one color to other (gradient) will cause bands to appear (less steps in between).
Dithering reduces this by placing random noise in color steps. With dither, we can use a noise of available colors to give an illusion of unavailable colors:
RGB_565
has low precision (2 bytes) than ARGB_8888
(4 bytes). Due to low color range, RGB_565
bitmaps can show banding and low color range. Hence, dither flag is use to improve perceived image, and give an illusion of more colors.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With