I want to compare the pixel of the two different images. I am comparing the pixel of first image with all the pixels of the second Image. Here is my code stuff:

```
for (int i = 0; i < bitmap.getWidth(); i++) {
    for (int j = 0; j < bitmap.getHeight(); j++) {

        for (int k = 0 ; k<bitmpa2.getWidth(); k++) {
            for (int l = 0 ; l<bitmpa2.getHeight(); l++) {

                if (bitmap.getPixel(i, j) == bitmap2.getPixel(k, l))
                  Counter++ ;
          }
       }
    }
}

```

Here the value of Counter is the number of pixels that are same in both the Images. The problem is that this works but it takes much time to perform it, so time constraint is the problem here, So what can I have to reduce the time and get exact result. Any other possibility is welcome.