Crate img_hash[−][src]
A crate that provides several perceptual hashing algorithms for images. Supports images opened with the image crate from Piston.
extern crate image; extern crate img_hash; use img_hash::{HasherConfig, HashAlg}; fn main() { let image1 = image::open("image1.png").unwrap(); let image2 = image::open("image2.png").unwrap(); let hasher = HasherConfig::new().to_hasher(); let hash1 = hasher.hash_image(&image1); let hash2 = hasher.hash_image(&image2); println!("Image1 hash: {}", hash1.to_base64()); println!("Image2 hash: {}", hash2.to_base64()); println!("Hamming Distance: {}", hash1.dist(&hash2)); }
Re-exports
pub extern crate image; |
Structs
Hasher | Generates hashes for images. |
HasherConfig | Start here. Configuration builder for |
ImageHash | A struct representing an image processed by a perceptual hash. For efficiency, does not retain a copy of the image data after hashing. |
Enums
FilterType | Available Sampling Filters. |
HashAlg | Hash algorithms implemented by this crate. |
InvalidBytesError | Error that can happen constructing a |
Traits
DiffImage | Image types that can be diffed. |
HashBytes | Interface for types used for storing hash data. |
Image | Shorthand trait bound for APIs in this crate. |