PHPackages                             lupka/phpunit-compare-images - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. lupka/phpunit-compare-images

ActivePackage[Testing &amp; Quality](/categories/testing)

lupka/phpunit-compare-images
============================

PHPUnit assertions for comparing image similarity.

1.0.0(9y ago)599.0k↓19.3%25MITPHP

Since Nov 1Pushed 9y ago1 watchersCompare

[ Source](https://github.com/lupka/phpunit-compare-images)[ Packagist](https://packagist.org/packages/lupka/phpunit-compare-images)[ RSS](/packages/lupka-phpunit-compare-images/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (5)

PHPUnit Compare Images
======================

[](#phpunit-compare-images)

PHPUnit assertions for assessing image similarity.

**IMPORTANT:** You may run into issues comparing different-sized images depending on your setup. I haven't been able to assess for certain what the issue is, but comparing different sized images works fine for me locally on OSX, but my tests fail in Travis CI if I use images with different sizes.

[![Travis](https://camo.githubusercontent.com/0954f54b978108de94b2dbc97f94fda67f6f6812c742d9133c95def722a9eb16/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6c75706b612f706870756e69742d636f6d706172652d696d616765732e737667)](https://travis-ci.org/lupka/phpunit-compare-images)[![Packagist](https://camo.githubusercontent.com/13f2777ee6d751aa7046414ae1255ab5704075a0827113b50c49667ed172ceb6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c75706b612f706870756e69742d636f6d706172652d696d616765732e737667)](https://packagist.org/packages/lupka/phpunit-compare-images)\[[![icense](https://camo.githubusercontent.com/f251623e510f5909f16ae3f4e6e548dac11340b9fde1a99be26b015b39272c00/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c6174)](https://camo.githubusercontent.com/f251623e510f5909f16ae3f4e6e548dac11340b9fde1a99be26b015b39272c00/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c6174)\](LICENSE)

Installation
------------

[](#installation)

```
composer require lupka/phpunit-compare-images

```

Usage
-----

[](#usage)

Add the `CompareImagesTrait` trait to your test class to enable the use of the assertions.

```
