This PHP Class compares two images (jpg or png) and returns a number that represents visual similarity.
The higher the number the farther away they are. The same image gives your the value 0. Changing an image's light, color, aspect ratio, size will result in close similarity, while completely different images will give you a higher number.