7

I am aware that there is one more question like mine, but I just thought mine was after all a bit different.

I have to be able to establish if the images are very similar or entirely different...
have a look at the following two images:
lighter image darker image

The first image is a bit lighter than the second image. You can see that on black striped fish in the middle.

So, comparing the md5 hashes doesn't really help. Is there anyother clever way to do it?
thanks!

Community
  • 1
  • 1
Marci-man
  • 2,113
  • 3
  • 28
  • 76
  • Container answer: [How to work out two images's degree of similarity using php](http://stackoverflow.com/a/4477483/367456) – hakre Oct 13 '13 at 19:08
  • [compare images with tolerance (ImageMagick Forums)](http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=23940) – hakre Oct 13 '13 at 19:21

4 Answers4

3

try that function

http://www.php.net/manual/en/function.imagick-compareimages.php

you will need to google for usage since the doc seems to be empty ...

Tarek
  • 3,810
  • 3
  • 36
  • 62
  • 1
    It is probably what I need, but my stupid webhosts say Imagick is not available... and can't be installed. You wouldn't be able to come up with something else now would you? :( – Marci-man Sep 07 '11 at 01:09
  • Oh I wish it was that easy... i am sort of their bich if you know what I mean :'( – Marci-man Sep 07 '11 at 01:48
  • Are you able to install the binaries locally and call them via exec()? – Eric Caron Sep 07 '11 at 02:20
0

I am not sure if it would help, but I think if you run the images through GD image processing, it would really help you there!

0

this way is useful

$img1 = md5(file_get_content($image1))
...
if($img1 == $img2){
..
}
Mustafa
  • 58
  • 4
0

Try this .Someone wrote open source code .

http://compareimages.nikhazy-dizajn.hu/

Compare Images PHP Class: This PHP Class compares two images and returns a number representing how similar they are. It is capable to tell if two pictures are similar even if they have different sizes or aspect ratio. Smaller number means the images are more similar. Numbers more than 10 means they are most likely not the same image.

Mian Anjum
  • 379
  • 2
  • 3
  • 16