10

I'm looking for a program that does a "diff" between two JPG images.

Requirements:

  1. The diff algorithm used by the app is known.

    Ideally, it should be verifiable via code inspection, but that's a nice-to-have, not a requirement.

    This excludes things like Beyond Compare.

  2. The diff algorithm (or even better, the specific implementation in this software) has been somehow proven to be reliable in the conditions of requirements below.

    "proven" means something like consensus of experts in image processing/computer vision field; peer reviewed publications, published large scale test results, etc...

  3. The algorithm and ideally the implementation needs to be resilient to type 1 and type 2 errors (e.g. it should have a provable and demonstrable low rate of both falsely showing large differences for nearly identical images, AND low rate of showing no differences for different images).

  4. The program should be able to handle images that have been minorly manipulated compared to each other, for example:

    • Small cropping of edges (say <10%)

    • Change in image quality (saving with slightly different compression)

    • Other minor changes (sharpness, contrast).

  5. Desired output should indicate the degree of similarity, either textually (92% similar) or visually (heat map, diff color coded map, etc...)


Nice-to-haves:

  • Open source (more specifically, ability to independently verify that the program indeed uses the algorithm it claims to use and that it was implemented in a correct way. E.g. if a reputable independent resource verified it and publicly acknowledged that, it's just as good as open source).

  • Freeware or low cost prefered. This isn't a requirement, but a strong preference. A professional service costing $100/image (or $100k license) isn't a good option.

OS/platform doesn't matter much (Windows, Linux, OS/2, webapp, whatever).

  • 1
    NOTE: I'm NOT looking for something that will tell me if an image was photoshopped, as per earlier similar question. I'm looking for JPG equivalent of Unix diff command. – DVK Aug 21 '14 at 17:16
6

This answer won't be as good as I usually like (due to lack of knowledge on my part) but I think it should work well for you.

What I would suggest is ImageMagick's Compare function. It is command line only but it outputs an 2 (error), 0 (similar) or 1 (disimilar) as well as image difference map - there are a few different types that it can output - see the docs for all the MANY options. In regards to your requirements:

  • 1: Don't know what Algorithm they are using - but it is Open Source (Apache 2.0)
  • 2: Same as #1
  • 3: sorta the same as #1 but there are also options to control thresholds so you can adjust that somewhat.
  • 4: It can detect when an image is included in another image, it can also detect the differences of sharpening only etc.
  • 5: visually and binary similarity output.
2

This is not really an answer but in case nothing better comes up, it could give an answer in the future :-)

There is our own online application, VIRaL, that allows for much more major changes like

  • major change of viewpoint (wide-baseline matching), resulting e.g. in major scale change or arbitrary orientation;
  • major occlusion, or partial matching to the extent that the two images may only have a small part (<20%) in common;
  • major change in lighting conditions.

Example, example.

This same application can search for similar photos in a database of millions and identify where a given photo is taken and what it depicts. Example, example. It can even automatically organize a bunch of photos by similarity or visualize a route on the map.

It uses well-known computer vision methods, some of which are our own, and has been evaluated in scientific publications. More here.

The application is only available online. It may get a query image through a user upload, but only compares to its own database. However, if there is interest, it is in general possible to pack at least part of this software according to your requirements. The typical run-time for one comparison would be in the order of one second.

This could be done as open source, but some components would still use existing software, and some of them might be proprietary (although the corresponding methods are documented in publications).

By the way, you might be interested in SE computer vision proposal.

0

I like to use BeyondCompare for every kind of comparison, even for an image comparison, because, BeyondCompare can show a heat map difference.
Also, you can use PSP Paint Shop Pro's arithmetic filters. There, you can make a difference of two images and get a new image, that will reveal the differences.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.