Calculate the difference in images
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples More experimentation with connected differences May 18, 2016
src
tests Refactored May 8, 2016
.gitattributes Refactored May 8, 2016
.gitignore Refactored May 8, 2016
.scrutinizer.yml Refactored May 8, 2016
.travis.yml Refactored May 8, 2016
code-of-conduct.md Refactored May 8, 2016
composer.json Added Composer license and description May 8, 2016
composer.lock Refactored May 8, 2016
contributing.md
license.md Refactored May 8, 2016
phpunit.xml Refactored May 8, 2016
readme.md

readme.md

Undemanding Difference

Build Status Code Quality Code Coverage Version License

Calculate the difference in images.

Usage

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...

You can ignore smaller changes by scaling and/or reducing the differences by a standard deviation:

$difference->withScale(10)->withReducedStandardDeviation();

Versioning

This library follows Semver. According to Semver, you will be able to upgrade to any minor or patch version of this library without any breaking changes to the public API. Semver also requires that we clearly define the public API for this library.

All methods, with public visibility, are part of the public API. All other methods are not part of the public API. Where possible, we'll try to keep protected methods backwards-compatible in minor/patch versions, but if you're overriding methods then please test your work before upgrading.