In order to compare the R, G and B composents between two pixels, cosine similarity http://en.wikipedia.org/wiki/Cosine_similarity is certainly the best solution.
After that, if you want to compare the arrays only by comparing couples of pixels that are in the same index, you can just sum the values. You can also sum a rapidly decreasing function of the values as they decrease (for example the square) if you want to discard cases where nearly all the pixels are the same but with one or two big differences. You can take the square root if you want the opposite (privilegiate the number of nearly identical pixels rather than the fewest differences).