Skip to content

aremmiw/imgcomp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

imgcomp

Lightweight program for image perceptual hashing using aHash/dHash/pHash. The hashes are unsigned 64-bit integers.

The main use of this program is to find images that are similar to one another, and to find duplicates (which can be deleted to save space). Duplicates are found using a Hamming distance.

Calculated hashes are stored in an SQLite database file in $HOME/.cache/imgcomp.sqlite or $XDG_CACHE_HOME/imgcomp.sqlite if $XDG_CACHE_HOME is defined.
If an images mtime and filesize are unchanged and there exists a hash for the chosen hashing algorithm, then it will use the precalculated hash. This saves a significant amount of time for repeated uses of imgcomp.

Only GNU/Linux is supported but *BSD will probably work.

usage

Usage: imgcomp [OPTION]... FILES...
Compare similarity of image files.

Hashing algorithms:
  -a, --ahash		use aHash (average hash)
  -d, --dhash		use dHash [DEFAULT]
  -p, --phash		use pHash (perceptive hash)

Other options:
  -s, --show-hashes	print calculated hashes of all files
  -t, --tolerance=NUM	control how similar images must be to be considered
			 'similar'. parameter NUM is an integer from
			 0 (identical) to 64 (very different). defaults to 5
  -h, --help		print this help

dependencies

  • ImageMagick 6 or 7 (including MagickWand)
  • sqlite3

build dependencies

  • gcc
  • make
  • pkg-config

building

Run make which will output an executable imgcomp.

About

Find similar images using perceptual hashing

Resources

License

Stars

Watchers

Forks

Contributors