FINDIMAGEDUPES(1p)
πΈ findimagedupes(1p) β User Contributed Perl Documentation πΈ
okay bestie, sit down, hydrate, and let me tell you about findimagedupes. she finds visually similar or duplicate images, and she does it by vibes (well, by fingerprints, but still). π
β¨ NAME β¨
findimagedupes β Finds visually similar or duplicate images π¦
β¨ 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
So like, if you give her no options at all, she just compares the files you handed her and she does not touch any fingerprint database. Not read it, not update it. Nothing. She's chill like that. π§
And yes you can absolutely throw whole directories at her instead of listing individual files. But heads up: she will not go diving into sub-directories unless you pass --recurse. The way that she just respects boundaries until invited. π
β¨ OPTIONS β¨
-0,--nullβ okay so when a file-is given, she reads a list of files from stdin. Without-0, that list is one file per line, exactly the format find(1) produces with its-printoption. With-0, the list is expected to be null-delimited instead, like whatfind(1)gives you with-print0. Pick your fighter. π₯-a,--addβ she only looks for duplicates of the files you specified on the commandline. But also, matches are still sought in any fingerprint databases you specified too. so like, both. she's thorough. π-c,--collection=FILEβ creates a GQView collectionFILE.gqvout of the duplicates. She genuinely tries to produce well-formed collections, okay? Specifically: if any file's name contains a newline or a doublequote, she prints a warning and excludes that file. (Because in that situation,gqview(1)apparently creates a.gqvcollection file that it then silently fails to read back in properly. embarrassing for gqview honestly. π)-d,--debug=OPTSβ turns on debugging output. The optionsOPTSare subject to change, so like, don't get attached. See the program source for details. π-f,--fingerprints=FILEβ useFILEas the fingerprint database. You can abbreviate it 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. commas stay losing.)-h,--helpβ prints the usage and option sections of this manual, then exits. the polite way to leave. π«Ά-i,--include=TEXTβTEXTis Bourne-shell code used to customise--script. It gets executed after any code included using--include-file. May be given multiple times, and the code will be concatenated. π§΅-I,--include-file=FILEβFILEis a file containing Bourne-shell code to customise--script. It gets executed before any code included using--include. (yes the -I and -i order is backwards from the alphabet, we don't make the rules, we just document them π)--manβ displays the full documentation using your default pager, then exits. the deluxe experience. β¨-M,--merge=FILEβ takes any databases specified with--fingerprintsand merges them into a new database calledFILE. And if two fingerprints for the same image conflict, one of two things happens:- 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's 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 β but if you do provide a list, 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 you want multiple fingerprint databases but you don't want the merge output, just specify: --merge=/dev/null π³οΈ
See also: --rescan
-n,--no-compareβ don't look for duplicates. that's it. that's the whole girl. π-p,--program=PROGRAMβ launchesPROGRAM(in the foreground) to view each set of dupes.PROGRAMmust be the full path to an existing executable file. Want more flexibility? See the--includeand--include-fileoptions. See also:--script. π-P,--pruneβ removes fingerprint data for images that don't 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. Normally, progress, warning and error messages get printed on stderr. If you give this option, warnings are not displayed. If you give it twice or more, errors are not displayed either. Information requested with--verbosityis still displayed though. π€«-R,--recurseβ use this to search recursively for images inside subdirectories. For historical reasons, the default is to not do so. And to avoid looping, symbolic links to directories are never followed. (safety first, always π‘οΈ)-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. Instead,sh(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 a 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 the 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's meaningless for"bits". Default is"90%"("25b") if not specified.-v,--verbosity=LISTβ enables display of informational messages tostdout, 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.
Alternatively, --verbosity may be given multiple times, and it accumulates. Note that this may not be sensible β for example, to be useful, md5 output probably should not be merged with fingerprint data. π΅βπ«
versionβ display the program version, then exit. β
β¨ DESCRIPTION β¨
findimagedupes compares a list of files for visual similarity. it's giving "spot the twin" but for your chaotic downloads folder. π―ββοΈ
So how does she calculate an image fingerprint? buckle up:
- Read image.
- Resample to
160x160to 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.
and to compare two images for similarity:
- Take fingerprint pairs and xor them.
- Compute the percentage of
1bits in the result. - If percentage exceeds threshold, declare files to be similar.
literally iconic pipeline. no notes. π
β¨ RETURN VALUE β¨
0β Success. slay. π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. (so like, if you see a weird number, something went wrong internally, don't @ me) π»
β¨ DIAGNOSTICS β¨
To be written. π (yeah. that's the whole section. bestie left it as a draft and honestly? relatable.)
β¨ EXAMPLES β¨
"findimagedupes -R -- ."
Look for and compare images in all subdirectories of the current directory. π³
"find . -type f -print0 | findimagedupes -0 -- -"
Same as above. (but make it piping β¨)
"findimagedupes -i 'echo "# sort: manual"' -i 'VIEW(){ for f in "$@";do echo \"file://$f\";done }' -- *.jpg > dupes.gqv"
Use script hooks to produce collection-style output suitable for use with gthumb(1). π
β¨ FILES β¨
To be written. π (yep, another draft. we're all doing our best out here.)
β¨ BUGS β¨
okay so, real talk, the receipts: π§Ύ
- There is a memory leak somewhere. π§
- Killing the program may corrupt the fingerprint database(s). (do not do this. do not be the person who does this. π¨)
- 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. (yes, just changing the version. brutal.) π
β¨ NOTES β¨
- Directory recursion is deliberately not implemented: composing a file-list and using it with
"-"is a more flexible approach. it's a design choice, and honestly? valid. π - Repetitions are culled before comparisons take place, so a commandline like
"findimagedupes a.jpg a.jpg"will not produce a match. so don't try to trick her into matching a file with itself, bestie, she's ahead of you. π§ - The program needs a lot of memory. Probably not an issue β unless your machine has less than
128MBof free RAM and you try to compare more than a hundred-thousand files at once (and she 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 β¨
gqview β GTK based multiformat image viewer πΌοΈ
gthumb β an image viewer and browser for GNOME π€
β¨ AUTHOR β¨
Jonathan H N Chin <code@jhnc.org> π
(bestie there is literally more, hold on β π)
π COPYRIGHT AND LICENSE π
okay bestie, legal era, stay with me because this actually matters:
Copyright Β© 2006-2022 by Jonathan H N Chin <code@jhnc.org>.
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. π«Ά
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, bestie, fr fr.
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
πΈ HISTORY πΈ
This code has been written from scratch, no cap. However it owes its existence to findimagedupes by Rob Kudla and uses the same duplicate-detection algorithm. iconic lineage behavior honestly π
and that's the whole page, bestie!! π
this was FINDIMAGEDUPES(1p), from perl v5.42.3, dated 2026-08-21 β go forth and dedupe your camera roll, you absolute main character π¦β¨π
π¦ where this page comes from
- ubuntu stonking: findimagedupes 2.20.1-6build1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms