krugozor/hash
最新稳定版本:1.0.0
Composer 安装命令:
composer require krugozor/hash
包简介
PHP Compare Image (Average Hash, Simple Hash)
README 文档
README
A fast image comparison library for PHP 8. Get Average Hash string and detect duplicate image. Solution from nvthaovn/CompareImage was refactored (tested on PHP 8.2).
Install
composer require krugozor/hash
Example (two similar but different pictures)
1.jpg
2.jpg
include './src/AverageHash.php'; $hash1 = AverageHash::getHash('1.jpg'); $hash2 = AverageHash::getHash('2.jpg'); echo "Difference between $hash1 and $hash2: " . AverageHash::compare($hash1, $hash2); // difference = 15
3.jpg
$hash3 = AverageHash::getHash('3.jpg'); echo "Difference between $hash1 and $hash3: " . AverageHash::compare($hash1, $hash3); // difference = 10 // if different rates <= 10 then the images are duplicate
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2024-11-16


