figif_core/hashers/mod.rs
1//! Built-in perceptual hash implementations.
2//!
3//! This module provides various hash algorithms for duplicate frame detection:
4//!
5//! - [`DHasher`]: Difference hash - fast, good for near-duplicates
6//! - [`PHasher`]: Perceptual hash (DCT) - robust to transformations
7//! - [`BlockHasher`]: Block average hash - balanced approach
8//!
9//! All hashers implement the [`FrameHasher`](crate::traits::FrameHasher) trait
10//! and can be used interchangeably.
11//!
12//! # Choosing a Hasher
13//!
14//! | Algorithm | Speed | Robustness | Best For |
15//! |-----------|-------|------------|----------|
16//! | dHash | Fast | Moderate | Frame-to-frame comparison |
17//! | pHash | Slow | High | Content matching across transforms |
18//! | BlockHash | Medium | Medium | General purpose |
19//!
20//! For GIF frame analysis, **dHash** is recommended as the default due to
21//! its speed and effectiveness for detecting consecutive duplicate frames.
22
23mod blockhash;
24mod dhash;
25mod phash;
26
27pub use blockhash::BlockHasher;
28pub use dhash::DHasher;
29pub use phash::PHasher;
30
31/// Re-export the ImageHash type from img_hash for convenience.
32pub use img_hash::ImageHash;