Dali
Dali copied to clipboard
Color distorted for RGB_565 bitmaps with renderscript blur algorithms
I need to copy to a new bitmap using ARGB_8888 config to get the correct image, otherwise the colors get really trippy
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
GlobalScope.launch(Dispatchers.IO) {
val url = "https://upload.wikimedia.org/wikipedia/commons/a/ad/Gretag-Macbeth_ColorChecker.jpg"
val stream = URL(url).openStream()
val bitmap = BitmapFactory.decodeStream(stream)
.copy(Bitmap.Config.RGB_565, false)
Dali.create(this@MainActivity)
.load(bitmap)
.skipCache()
.blurRadius(12)
.into(image);
}
}
}
Hmm, if you use the default config, this lib just uses the built-in renderscript blur algo. I think I never tested with 565, but I guess there is no easy fix for this - aka I believe this is a Renderscript bug.
Relates to #20