Download the PHP package travail/image-perceptualhash without Composer
On this page you can find all versions of the php package travail/image-perceptualhash. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download travail/image-perceptualhash
More information about travail/image-perceptualhash
Files in travail/image-perceptualhash
Package image-perceptualhash
Short Description travail/image-perceptualhash
License PHP-3.0
Informations about the package image-perceptualhash
Image\PerceptualHash
NAME
Image\PerceptualHash - Generate comparable hash from images
SYNOPSIS
DESCRIPTION
Image\PerceptualHash generates distinct, but not unique fingerprint with three hashing algorithms. Unlike cryptographic hashing, these fingerprints from similar images will be also similar.
DEPENDENCIES
- ext-gd
INSTALLATION
To install this package into your project via composer, add the following snippet to your composer.json
. Then run composer install
.
or
TESTS
After cloning the project, run composer install
and ./vendor/bin/phpunit
.
METHODS
__construct
Creates a new instance of Image\PerceptualHash and calculates hashes.
$file
Path to a file or a resource of that.
Algorithm $algorithm
Hashing algorithm, currently the following algorithm are available:
- AverageHash
- DifferenceHash
- PerceptionHash
bin
Returns calculated binary hash.
hex
Returns calculated hexadecimal hash.
compare
Compares with another image and returns the Hamming distance to that.
$file
Path to a file or a resource of that.
distance
similarity
Calculates the similarity to another image.
$file
Path to a file or a resource of that.
AUTHOR
travail
LICENSE
This library is free software. You can redistribute it and/or modify it under the same terms as PHP itself.