{"id":13439726,"url":"https://github.com/abonander/img_hash","last_synced_at":"2025-05-15T13:04:25.849Z","repository":{"id":23465147,"uuid":"26829341","full_name":"abonander/img_hash","owner":"abonander","description":"A Rust library for calculating perceptual hash values of images","archived":false,"fork":false,"pushed_at":"2024-03-13T10:11:47.000Z","size":1160,"stargazers_count":316,"open_issues_count":12,"forks_count":65,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-07T14:09:42.267Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abonander.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-11-18T20:49:53.000Z","updated_at":"2025-03-23T08:47:22.000Z","dependencies_parsed_at":"2024-06-19T00:10:48.893Z","dependency_job_id":"b6397591-69da-45a2-9855-eb7cd62ae925","html_url":"https://github.com/abonander/img_hash","commit_stats":{"total_commits":167,"total_committers":12,"mean_commits":"13.916666666666666","dds":0.2574850299401198,"last_synced_commit":"dbfb37f9251fea8f7efeabbb2267ddb1fcd21ca6"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abonander%2Fimg_hash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abonander%2Fimg_hash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abonander%2Fimg_hash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abonander%2Fimg_hash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abonander","download_url":"https://codeload.github.com/abonander/img_hash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248961112,"owners_count":21189991,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T03:01:16.575Z","updated_at":"2025-04-14T20:55:07.504Z","avatar_url":"https://github.com/abonander.png","language":"Rust","funding_links":[],"categories":["Libraries","库 Libraries","库","Machine Learning"],"sub_categories":["Image processing","图像处理 Image processing","图像处理"],"readme":"img_hash [![Build Status](https://travis-ci.org/abonander/img_hash.svg?branch=master)](https://travis-ci.org/abonander/img_hash) [![Crates.io shield](https://img.shields.io/crates/v/img_hash.svg)](https://crates.io/crates/img_hash)\n========\n\n##### Now builds on stable Rust! (But needs nightly to bench.)\n\nA library for getting perceptual hash values of images.\n\nThanks to Dr. Neal Krawetz for the outlines of the Mean (aHash), Gradient (dHash), and DCT (pHash) perceptual hash algorithms:  \nhttp://www.hackerfactor.com/blog/?/archives/432-Looks-Like-It.html (Accessed August 2014)\n\nAlso provides an implementation of [the Blockhash.io algorithm](http://blockhash.io).\n\nThis crate can operate directly on buffers from the [PistonDevelopers/image][1] crate.\n\n[1]: https://github.com/PistonDevelopers/image \n\nUsage\n=====\n[Documentation](https://docs.rs/img_hash)\n\n\nAdd `img_hash` to your `Cargo.toml`:\n\n    [dependencies.img_hash]\n    version = \"3.0\"\n    \nExample program:\n\n```rust\n extern crate image;\n extern crate img_hash;\n \n use img_hash::{HasherConfig, HashAlg};\n\n fn main() {\n     let image1 = image::open(\"image1.png\").unwrap();\n     let image2 = image::open(\"image2.png\").unwrap();\n     \n     let hasher = HasherConfig::new().to_hasher();\n\n     let hash1 = hasher.hash_image(\u0026image1);\n     let hash2 = hasher.hash_image(\u0026image2);\n     \n     println!(\"Image1 hash: {}\", hash1.to_base64());\n     println!(\"Image2 hash: {}\", hash2.to_base64());\n     \n     println!(\"Hamming Distance: {}\", hash1.dist(\u0026hash2));\n }\n```\n   \nBenchmarking\n============\n\nIn order to build and test on Rust stable, the benchmarks have to be placed behind a feature gate. If you have Rust nightly installed and want to run benchmarks, use the following command:\n\n```\ncargo bench --features bench\n```\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any\nadditional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabonander%2Fimg_hash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabonander%2Fimg_hash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabonander%2Fimg_hash/lists"}