1

suppose there is an image on web without watermark. And someone downloads it and makes some edits on it like adding watermark etc etc. Is it possible to write a script in php to compare these two images. Like when I submit these two images to the script, it should be able to output the original image and manipulated image.

I read google's webmaster page which says

Google often finds multiple copies of the same image online. We use many different signals to identify the original source of the image Blockquote

This is the main concern of my question

One more doubt is will there be any meta tags inside an image. if at all how to read them. Is it possible to edit them. Are there any information(not visual) inside an image which cannot be edited.

Krishna Deepak
  • 1,735
  • 2
  • 20
  • 31
  • What you're looking for is VERY hard to accomplish (if not impossible today). – Paul Dessert Apr 18 '12 at 22:44
  • Have a look at http://stackoverflow.com/questions/4477417/how-to-work-out-two-imagess-degree-of-similarity-using-php and the links over there... – ChristopheD Apr 18 '12 at 22:44
  • 1
    If you find information inside an image which cannot be edited my hex editor says she would like to have a look. – Jon Apr 18 '12 at 22:44
  • If I understand correctly, your question is less "how to find the original source of an image" and more like "if I have two images, is there any way to tell whether one of them is an edit of the other"? – octern Apr 18 '12 at 22:45
  • @DavidThomas is it a regular stuff to ask this question "What have you tried?". REad the question properly first. Is it simple enough to try at on this. I have absolutely no idea where to start. I am looking for guidelines and not the exact code. Understand that first. Obviously I tried a lot on google and only important link seemed to be of tiny eye. – Krishna Deepak Apr 18 '12 at 22:47
  • @octern, actually I have seen on google pages that says google can get signals which tell them the original source of an image. I am wondering how they do it. – Krishna Deepak Apr 18 '12 at 22:48
  • "I am wondering how they do it" Employ thousands of top-tier engineers ;) – Paul Dessert Apr 18 '12 at 22:51
  • Yes, it is. Or should be. Because while we *like* to help people, we do like it when those people have made some effort to help themselves, first. This site is for [specific programming questions](http://stackoverflow.com/faq#questions), not [discussions](http://stackoverflow.com/faq#dontask), if you have no code to show then you don't have a 'specific programming question,' and seem to be asking for suggestions. – David Thomas Apr 18 '12 at 22:52
  • It's possible that google uses their immense hoard of cached data to determine which version of an image appeared on the web first and trace how it propagated. – octern Apr 19 '12 at 01:16

3 Answers3

3

Anything within the image can be edited (it is, after all, just a collection of bytes), and it's definitely trivial for someone to add a watermark to an image, or simply change the contrast ever-so-slightly, to make it a very different file from the original. There are several other non-destructive changes that would make image files look completely different to a naive comparison algorithm (e.g., scaling, changing filetypes and compression, changing brightness, rotation, etc.).

Advanced image processing algorithms, however, can still often identify similarities between images that have been manipulated in ways like those above. There are many algorithms to do this, and honestly you could spend thousands of hours trying to roll an algorithm like this yourself. These sorts of algorithms are referred to as "content-based image retrieval."

You might be better off calling into engine that's already been developed to do exactly this. Here are some possibilities:

Good luck!

Community
  • 1
  • 1
NattyBumppo
  • 336
  • 2
  • 8
2

Photos taken by digital cameras usually have exif data embedded.

You can get the data with the exif_read_data function in PHP.

As for identifying similar images, here's some useful resources:

Community
  • 1
  • 1
HappyTimeGopher
  • 1,377
  • 9
  • 14
0

You could submit both images to ImageEdited and see which one has been edited. Even if the exif data's missing, it tells when an image has been created with a program.

D Robey
  • 86
  • 1
  • 1