Imgfprint — high-performance image fingerprinting library for Rust

Hi everyone,

I recently released imgfprint, a Rust crate for generating deterministic image fingerprints and computing similarity between images.

The goal of the crate is to provide a small SDK for image deduplication and similarity detection, without bundling indexing or database components.

GitHub

Crate
https://crates.io/crates/imgfprint

Features

  • perceptual hashing for visual similarity detection
  • exact hashing for byte-level identity checks
  • optional semantic embeddings (CLIP)
  • deterministic fingerprints suitable for large-scale pipelines

Example

use imgfprint::ImageFingerprinter;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let img1 = std::fs::read("photo1.jpg")?;
    let img2 = std::fs::read("photo2.jpg")?;

    let fp1 = ImageFingerprinter::fingerprint(&img1)?;
    let fp2 = ImageFingerprinter::fingerprint(&img2)?;

    let sim = ImageFingerprinter::compare(&fp1, &fp2);

    println!("Similarity: {:.2}", sim.score);
    println!("Exact match: {}", sim.exact_match);

    if sim.score > 0.8 {
        println!("Images are perceptually similar");
    }

    Ok(())
}

The library is intended for applications like dataset deduplication, media similarity search, and preprocessing pipelines.

Feedback and suggestions are welcome.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.