PHP code example of vajiral / php-image-compare

1. Go to this page and download the library: Download vajiral/php-image-compare library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

vajiral / php-image-compare example snippets




use BigV\ImageCompare;

lmost the same so the hammered distance will be less than 10
 * Try it with images like below:
 * 1. Two slightly different images
 * 2. Two completely different images
 * 3. Two same images (returned value 0)
 * 4. Two same image but with different size/aspect ratio (returned value ~0)
 */

$image = new ImageCompare();
echo $image->compare(__DIR__ . '/image2-resize.jpg',__DIR__ . '/image2.jpg');

"vajiral/php-image-compare": "1.0.1"