Quantcast
Channel: php – Bram.us
Viewing all articles
Browse latest Browse all 166

Image diffing using PHP

$
0
0

php-logo

PHP package by Undemanding to calculate how much difference (in percent) there is between two images:

use Undemanding\Difference\Image;
use Undemanding\Difference\Method\EuclideanDistance;

$image1 = new Image("/path/to/image1.png");
$image2 = new Image("/path/to/image2.png");

$difference = $image1->difference($image2, new EuclideanDistance());

$boundary = $difference->boundary(); // → ["left" => ..., "top" => ...]
$percentage = $difference->percentage(); // → 14.03...

Undemanding Difference →


Viewing all articles
Browse latest Browse all 166

Latest Images

Trending Articles



Latest Images