public static Bitmap doInvert(Bitmap src)
{
int A, R, G, B;
int pixelColor;
int height = src.getHeight();
int width = src.getWidth();
Bitmap returnBitmap = Bitmap.createBitmap(width, height, src.getConfig());
for (int y = 0; y < height; y++)
{
for (int x = 0; x < width; x++)
{
pixelColor = src.getPixel(x, y);
A = Color.alpha(pixelColor);
R = 255 - Color.red(pixelColor);
G = 255 - Color.green(pixelColor);
B = 255 - Color.blue(pixelColor);
returnBitmap.setPixel(x, y, Color.argb(A, R, G, B));
}
}
return returnBitmap;
}