FINDIMAGEDUPES(1)
πΈ bestie, meet findimagedupes(1) πΈ
okay so this is the findimagedupes(1) page from User Contributed Perl Documentation, and it's here to help you find visually similar or duplicate images. no cap, it's iconic. π
β¨ NAME β¨
findimagedupes β finds visually similar or duplicate images. literally the whole vibe. π¦
π SYNOPSIS π
findimagedupes [option ...] [--] [ - | [file ...] ]
Options:
-f, --fingerprints=FILE -c, --collection=FILE
-M, --merge=FILE -p, --program=PROGRAM
-P, --prune -s, --script=FILE
-a, --add -i, --include=TEXT
-r, --rescan -I, --include-file=FILE
-n, --no-compare
-q, --quiet
-t, --threshold=AMOUNT -v, --verbosity=LIST
-0, --null -h, --help
-R, --recurse --man
--version
With no options, it compares the specified files and does not use nor update any fingerprint database. π«Ά
Directories of images may be specified instead of individual files; Sub-directories of these are not searched unless --recurse is used. ποΈ
π INSTALLATION π
If you use linux, your distribution may include a prepackaged version. For example, Debian and Ubuntu do. slay for them. π§
Otherwise, at a minimum you'll need Perl with the modules listed at the top of the findimagedupes script. Also the GraphicksMagick package. (yes, GraphicksMagick β that's what the page says, bestie.)
You may need to change Inline's "DIRECTORY" to point somewhere else. Read the Inline module documentation for details. π
π OPTIONS π
-0,--nullβ If a file-is given, a list of files is read from stdin. Without-0, the list is specified one file per line, such as produced byfind(1)with its-printoption. With-0, the list is expected to be null-delimited, such as produced byfind(1)with its-print0option. π-a,--addβ Only look for duplicates of files specified on the commandline. Matches are also sought in any fingerprint databases specified. π₯-c,--collection=FILEβ Create GQView collectionFILE.gqvof duplicates. The program attempts to produce well-formed collections. In particular, it will print a warning and exclude any file whose name contains newline or doublequote. (In this situation,gqview(1)seems to create a.gqvcollection file that it silently fails to read back in properly.) π-d,--debug=OPTSβ Enable debugging output. OptionsOPTSare subject to change. See the program source for details. π-f,--fingerprints=FILEβ UseFILEas fingerprint database. May be abbreviated as--fpor--db. This option may be given multiple times when--mergeis used. (Note:FILEcould contain commas, so multiple databases may not be specified as a single comma-delimited list.) π-h,--helpβ Print usage and option sections of this manual, then exit. β¨-i,--include=TEXTβTEXTis Bourne-shell code to customise--script. It is executed after any code included using--include-file. May be given multiple times. Code will be concatenated. π§-I,--include-file=FILEβFILEis a file containing Bourne-shell code to customise--script. It is executed before any code included using--include. πΈ--manβ Display the full documentation, using default pager, then exit. π-M,--merge=FILEβ Takes any databases specified with--fingerprintsand merges them into a new database calledFILE. Conflicting fingerprints for an image will cause one of two actions to occur:- If the image does not exist, then the entry is elided.
- If the image does exist, then the old information is ignored and a new fingerprint is generated from scratch.
By default, image existence is not checked unless there is a conflict. To force removal of defunct data, use --prune as well.
A list of image files is not required if this option is used. However, if a list is provided, fingerprint data for the files will be copied or (re)generated as appropriate.
When --merge is used, the original fingerprint databases are not modified, even if --prune is used.
If multiple fingerprint databases are to be used but the merge output is not required, specify: --merge=/dev/null
See also: --rescan
-n,--no-compareβ Don't look for duplicates. π-p,--program=PROGRAMβ LaunchPROGRAM(in foreground) to view each set of dupes.PROGRAMmust be the full path to an existing executable file. For more flexibility, see the--includeand--include-fileoptions. See also:--script. π₯οΈ-P,--pruneβ Remove fingerprint data for images that do not exist any more. Has no effect unless--fingerprintsor--mergeis also used. Databases specified by--fingerprintsare only modified if--mergeis not used. π§Ή-q,--quietβ This option may be given multiple times. Usually, progress, warning and error messages are printed on stderr. If this option is given, warnings are not displayed. If it is given twice or more, errors are not displayed either. Information requested with--verbosityis still displayed. π€«-R,--recurseβ Use--recurseto search recursively for images inside subdirectories. For historical reasons, the default is to not do so. To avoid looping, symbolic links to directories are never followed. π-r,--rescanβ (Re)generate all fingerprints, not just any that are unknown. If used with--add, only the fingerprints of files specified on the commandline are (re)generated. Implies--prune. π-s,--script=FILEβ When used with--program,PROGRAMis not launched immediately. Insteadsh(1)-style commands are saved toFILE. This script may be edited (if desired) and then executed manually. When used without--program, two skeletal shell functions are generated:"VIEW"simplyecho(1)s its arguments; the empty function"END"runs after files-processing is finished. To display to terminal (or feed into a pipe), use"-"asFILE. If--scriptis not given, the script is still created in memory and is executed immediately. So, with the defaultVIEWandENDfunctions, lines containing sets of duplicates are displayed. See: EXAMPLES. See also:--include,--include-file. π¬-t,--threshold=AMOUNTβ UseAMOUNTas threshold of similarity. Append"%"to give a percentage or"b"for bits. For backwards compatibility, a number with no unit is treated as a percentage. Percentage is the minimum required for a match; bits is the maximum that may differ:bits=floor(2.56(100-percent)). A fractional part may be given but it is only accurate to100/256 (0.390625)for percentage and it is meaningless for"bits". Default is"90%"("25b") if not specified. π―-v,--verbosity=LISTβ Enable display of informational messages to stdout, whereLISTis a comma-delimited list of:md5β Display the checksum for each file, as permd5sum(1). π§Ύfingerprint|fpβ Display the base64-encoded fingerprint of each file. πversionβ Display the program version, then exit. π
Alternatively, --verbosity may be given multiple times, and accumulates. Note that this may not be sensible. For example, to be useful, md5 output probably should not be merged with fingerprint data.
π¦ DESCRIPTION π¦
findimagedupes compares a list of files for visual similarity. it's giving "are these the same pic or just siblings?" energy. π―
To calculate an image fingerprint:
- Read image.
- Resample to 160x160 to standardize size.
- Grayscale by reducing saturation.
- Blur a lot to get rid of noise.
- Normalize to spread out intensity as much as possible.
- Equalize to make image as contrasty as possible.
- Resample again down to 16x16.
- Reduce to 1bpp.
- The fingerprint is this raw image data.
To compare two images for similarity:
- Take fingerprint pairs and xor them.
- Compute the percentage of 1 bits in the result.
- If percentage exceeds threshold, declare files to be similar.
π RETURN VALUE π
0β Success. π1β Usage information was requested (--helpor--man), or there were warnings. π€2β Invalid options or arguments were provided. π«3β Runtime error. π₯
Any other return values indicate an internal error of some sort. π
π DIAGNOSTICS π
To be written. literally that's the whole section β placeholder era. π
π EXAMPLES π
Example 1: Look for and compare images in all subdirectories of the current directory.
findimagedupes -R -- .
Example 2: Same as above.
find . -type f -print0 | findimagedupes -0 -- -
Example 3: Use script hooks to produce collection-style output suitable for use with gthumb(1).
findimagedupes -i 'echo "# sort: manual"' -i 'VIEW(){ for f in "$@";do echo \"file://$f\";done }' -- *.jpg > dupes.gqv
π FILES π
To be written. another placeholder, bestie. π«
π BUGS π
- There is a memory leak somewhere. π§
- Killing the program may corrupt the fingerprint database(s). β οΈ
- The program does not lock the fingerprint database although concurrent write access to it is unsafe. π
- GraphicsMagick does not expose its auto-orient functionality to Perl. π
- Changing version of GraphicsMagick invalidates fingerprint databases. π
π NOTES π
Directory recursion is deliberately not implemented: Composing a file-list and using it with "-" is a more flexible approach. (iykyk.)
Repetitions are culled before comparisons take place, so a commandline like findimagedupes a.jpg a.jpg will not produce a match. no duplicate-on-duplicate action here. π
ββοΈ
The program needs a lot of memory. Probably not an issue, unless your machine has less than 128MB of free RAM and you try to compare more than a hundred-thousand files at once (and the program will run quite slowly with that many files anyway---about eight hours initially to generate fingerprints and another ten minutes to do the actual comparing). π§
Fingerprinting images is a bottleneck but unfortunately the program was not written with parallel processing in mind. For a workaround, see: https://github.com/jhnc/findimagedupes/issues/9 β³
π«Ά SEE ALSO π«Ά
find(1),md5sum(1)gqview- GTK based multiformat image viewergthumb- an image viewer and browser for GNOME
π AUTHOR π
Jonathan H N Chin <code@jhnc.org>
π COPYRIGHT AND LICENSE π
okay bestie, legal era, but it's actually kinda wholesome so stay with me π
Copyright Β© 2006-2022 by Jonathan H N Chin <code@jhnc.org>.
shoutout to the author, no cap, they've been holding it down since 2006 and are still at it through 2022 π
Here's the actual license tea β this program is free software, and yes you're allowed to do stuff with it:
This program is free software; you may redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
and the "we promise nothing" part, which is lowkey important so don't skip it:
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
like, it's genuinely free and it genuinely might not work, both things are true at once, it's giving duality β¨
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
didn't get your copy? kind of a them problem but here's the address anyway, go write a letter, it's giving pen pal vibes π
π¦ HISTORY π¦
okay so the lore π
This code has been written from scratch. However it owes its existence to findimagedupes by Rob Kudla and uses the same duplicate-detection algorithm.
so like β brand new code, written from zero, not a fork, not a copy, however π it literally would not exist without findimagedupes by Rob Kudla, and it runs the exact same duplicate-detection algorithm. iconic behaviour honestly, giving credit where it's due, we love to see it π«Ά
and that's the whole page bestie, you made it to the end, i'm so proud π₯Ήβ¨ this one was served up in perl v5.42.3, dated 1980-01-01 β yeah the date is a whole vibe of its own, i don't make the rules π
π bye ily π
π¦ where this page comes from
- nixos 26.05: findimagedupes 2.20.1
- nixpkgs unstable: findimagedupes 2.20.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms