https://www.2cto.com/kf/201611/567911.html
int w = bitmap0.getWidth();
int h = bitmap0.getHeight();
int[] pixels = new int[w * h];
bitmap0.getPixels(pixels, 0, w, 0, 0, w, h);
for (int i=0; i<w*h; i++) {
int color = pixels[i];
int a = Color.alpha(color);
int r = Color.red(color);
int g = Color.green(color);
int b = Color.blue(color);
r = 255 - r;
g = 255 - g;
b = 255 - b;
pixels[i] = Color.argb(a, r, g, b);
}
//直接修改bitmap崩溃
Bitmap bitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
bitmap.setPixels(pixels, 0, w, 0, 0, w, h);
bitmap0 = bitmap;
imageView.setImageBitmap(bitmap0);