Skip to content

quick python script to check if any images in a directory are duplicates

Notifications You must be signed in to change notification settings

mjgiarlo/ImageDuplicateCheck

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ImageDuplicateCheck

Check a directory for duplicate images. If a duplicate image is found, it will spit out the names of both images. Supports recursive directory searching.

Installation (may require administrative privileges)

  python setup.py install

Command-line usage

  $ bin/imgdupcheck test/
  test/py-copy-2.png  test/py-orig.png	test/py-copy.png
  test/py-2-copy.png  test/py-2.png

  $ bin/imgdupcheck -r test/
  test/dups/py-copy-2.png	test/dups/py-orig.png	test/dups/py-copy.png	test/nodups/py-orig.png
  test/dups/py-2-copy.png	test/dups/py-2.png	test/nodups/py-2.png

API usage

  """ python """
  import imgdupcheck

  duplicates = imgdupcheck.check_images('/home/me/images', recursive=True)
  for dupset in duplicates:
      imgpaths = " ".join(dupset)
      print "These are all the same image: %s" % imgpaths
          
  import Image

  img1 = Image.open('py-orig.png')
  img2 = Image.open('py-copy.png')
  if imgdupcheck.is_same_image(img1, img2):
      do_something()

Test suite

  python setup.py test

About

quick python script to check if any images in a directory are duplicates

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%