14 releases (3 stable)

1.1.1 Apr 3, 2025
1.1.0 Apr 2, 2025
1.0.0 Mar 31, 2025
0.3.0 Jan 26, 2025
0.1.2 Nov 27, 2023

#480 in Command line utilities

Download history 96/week @ 2025-01-22 14/week @ 2025-01-29 4/week @ 2025-02-05 7/week @ 2025-02-12 1/week @ 2025-02-26 81/week @ 2025-03-26 318/week @ 2025-04-02

399 downloads per month

GPL-3.0-or-later

31KB
676 lines

Crates.io AUR version

simagef is a CLI tool for finding similar images. It takes a list of image paths and returns either groups or pairs of images that are similar.

It uses the image-match crate to generate signatures for images and compare them. An option to match images using pixel comparisons via the image-compare crate is also available with the pixel feature flag.

simagef is faster than the findimagedupes Perl script, but might not produce identical results - not even across the signature/pixel modes, and is not designed to be a drop-in replacement.

Performance

Comparing 10,198 small to medium sized images, simagef takes 40 seconds while findimagedupes takes 1 minute 44 seconds.

Installation

Install via cargo on most platforms:

cargo install simagef

or with the pixel feature:

cargo install simagef --features pixel

Install on Arch Linux:

yay simagef-bin

Usage

To compare a set of images:

simagef a.png b.png c.png

You can set the threshold of similarity with the -t or --threshold options:

simagef -t 50 a.png b.png c.png

You can additionally read filenames from stdin if - appears in the filenames list. For example using it with the fd command for finding files:

fd . ~/my_images | simagef base.png base2.png -

You can use the (slower) pixel-based algorithm with the -m or --pixels flag.

If you want only the pairs of images without the groupings, use the -p or --pairs flag.

You can specify an external image viewer for comparing groups of images using -e or --exec. You can also provide command line arguments:

simagef -e "gwenview -s" ~/Pictures/*

This will launch the executable with the groups (or pairs) of filenames as arguments. It will launch the executable again for the next group once the previous executable exits.

Caveats

  • The groups are created using a recursive graph algorithm.

Dependencies

~9–17MB
~191K SLoC