I need to iterate through each pixel of the Bitmap image, this is my code, but it's too slow
Bitmap img=......;
int imgWidth = img.getWidth();
int imgHeight = img.getHeight();
for (int i = 0; i < imgWidth; i++) {
for (int j = 0; j < imgHeight; j++) {
int color = img.getPixel(i, j);
int R = android.graphics.Color.red(color);
int G = android.graphics.Color.green(color);
int B = android.graphics.Color.blue(color);
// do something
}
}