I am developing an Image manipulation software in android.i want to change the brightness of an particular image.how it can be done in code?
I'm using something like this at the moment:
if (brighter)
{
darknessPaint.setColorFilter(new PorterDuffColorFilter(Color.argb(level, 255, 255, 255), Mode.SRC_OVER));
}
else
{
darknessPaint.setColorFilter(new PorterDuffColorFilter(Color.argb(level, 0, 0, 0), Mode.SRC_ATOP));
}
darknessCanvas.setBitmap(dst);
darknessCanvas.drawBitmap(src, 0, 0, darknessPaint);
Indeed you could use LightningColorFilter too or ColorMatrixColorFilter. If anyone has a better (and by that I mean faster, besides using JNI which I haven't tried yet) method please let me know.
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