Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I download archives, they often contain images I already have in another folder, but mostly with another name or file-format.

My question: What script / software 1 do you know, that can recognize 2 duplicate images?

It should let you decide if they are really the same (and possibly remove the images with inferior quality).

1 at best cross-platform, but Linux would be sufficient

2 e.g. by their color-difference or something

share|improve this question
1  
You might want to look here: superuser.com/questions/326468/… –  gentlesea Jun 26 '12 at 12:36
add comment

3 Answers

up vote 4 down vote accepted

for windows their is a small freeware "visipic". it can search for similar pictures and give you the option to delete or move the files according to their quality.

download visipic http://www.visipics.info/index.php?title=Download

share|improve this answer
1  
I love VisiPics, also it does state the developer has tested it under Wine. –  Christopher Galpin Apr 2 '11 at 19:09
    
Thank you, this worked very well under Wine. Awesome! –  Joschua Apr 18 '11 at 20:52
add comment

A bit of python magic can help you here. Making sure that PIL is installed:

import os, sys, glob
import ImageChops, Image


def equal(im1, im2):
    return ImageChops.difference(im1, im2).getbbox() is None

dir1 = sys.argv[1]
dir2 = sys.argv[2]

for im1 in glob.glob(os.path.join(dir1, "*.jpg")):
    for im2 in glob.glob(os.path.join(dir2, "*.jpg")):
        if im1!=im2 and equal(Image.open(im1), Image.open(im2)):
            print im1, "==", im2

Assuming the script is saved as image-diff.py:

$python image-diff.py dir1 dir2

It will look for all JPG images in dir1 and dir2, and compare them. It works in O(N^2) excluding the time ImageChops.difference takes, so may be not suitable for large set of image archives. But gives you the idea. Modify and hack as you please.

share|improve this answer
add comment

For byte by byte copies of images, you can use the diff command in a terminal (man diff) For images that probably aren't identical logically, there's a program named fdupes that I used to use in ubuntu.

share|improve this answer
add comment

protected by Community Feb 11 '13 at 10:40

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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