You can compare two text files very easy with diff
and even better with meld:
If you use diff for images, you get an example like this:
$ diff zivi-besch.tif zivildienst.tif
Binary files zivi-besch.tif and zivildienst.tif differ
Here is an example:
Original from http://commons.wikimedia.org/wiki/File:Tux.svg
Edited:
I've added a white background to both images and applied GIMPs "Difference" filter to get this:
It is a very simple method how a diff could work, but I can imagine much better (and more complicated) ones.
Do you know a program which works for images like meld does for texts?
(If a program existed that could give a percentage (0% the same image - 100% the same image) I would also be interested in it, but I am looking for one that gives me visual hints where differences are.)
Yes, such a program exists!
ImageMagick has the
compare
utility, which has several ways of comparing images.To install it:
Comparing two images visually:
tux_orig.png
&tux_modified.png
Gives this image:
Comparing two images via metrics:
There are also many ways to output the differences via some metrics, e.g.:
Some metric options:
There are many ways to compare images, see ImageMagicks section on compare for further methods.
idiff
in package openimageio-tools (homepage).perceptualdiff
in package perceptualdiff (homepage).uprightdiff
in package uprightdiff (homepage).This question was ask back in 2012, and it's 2017. We now have the non-open-source program Beyond Compare to compare images, and it integrates into Nautilus. We have also had Geeqie all along for finding similar images throughout a directory structure (recursively).
I. Finding Image Differences With Beyond Compare
Click this link to download Beyond Compare .deb packages.
Install the package by going to the directory you downloaded the package too, and typing: sudo dpkg -i YourPackageName.deb which at this moment is called bcompare-4.2.2.22384_amd64.deb, so you would type: sudo dpkg -i bcompare-4.2.2.22384_amd64.deb
To complete the install and get the plugin to work in Nautilus, you will need to log out, and then back in, because Nautilus is running in the background even if you don't have it open.
Once it is installed and the plugin is working properly, you:
Open Nautilus, and browse to the first image
Right-click the first image to bring up the context menu, and select Select Left File for Compare/Merge
Browse to the second image
Right-click the second image, and select Compare to 'NameOfFirstImageFile' where NameOfFirstImageFile is the name of the file you selected in step 2.
The images will then open up in Beyond Compare, and it will look something like this:
II. Finding Similar/Duplicate Images With Geeqie
Install Geeqie by tying this into a terminal: sudo apt install geeqie
Open Geeqie, and browse to the directory you want to scan.
Right-click the name of the directory you want to scan and select Find duplicates... to just scan that directory, or select Find duplicates recursive... to scan that directory and all directories under it.
Using the Compare by drop-down list in the lower left corner, you can choose to find duplicates by Checksum, by Filename, or by Similarity levels. The similarity feature is awesome if you have cropped, rotated, or resized images, you no longer need, as many of us acquire, when we crop/resize pictures to post on social media and such.
I ended up with the following:
~/.gitconfig
Append
simple-imagediff
I've added the following to
~/.local/bin/simple-imagediff
: