note 114944 added to imagick.compareimages
| From: | TimKandSamM at netflix | Date: | Thu, 01 May 2014 18:09:52 +0000 |
| Subject: | note 114944 added to imagick.compareimages | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-199398@lists.php.net to get a copy of this message | ||
The *Absolute Error* metric is not listed as an available metric constant. However, you can still
use it if needed by passing the internal constant definition for AE which is 1. This is useful when
you wish to compare using a desired fuzz factor. Example:
<?php
// init the image objects
$image1 = new imagick();
$image2 = new imagick();
// set the fuzz factor (must be done BEFORE reading in the images)
$image1->SetOption('fuzz', '2%');
// read in the images
$image1->readImage("php_step29_actual.png");
$image2->readImage("php_step29_correct.png");
// compare the images using METRIC=1 (Absolute Error)
$result = $image1->compareImages($image2, 1);
// print out the result
echo "The image comparison 2% Fuzz factor is: " . $result[1];
?>
----
Server IP: 72.52.91.14
Probable Submitter: 69.53.237.72
----
Manual Page -- http://php.net/manual/en/imagick.compareimages.php
Edit -- https://master.php.net/note/edit/114944
Del: integrated -- https://master.php.net/note/delete/114944/integrated
Del: useless -- https://master.php.net/note/delete/114944/useless
Del: bad code -- https://master.php.net/note/delete/114944/bad+code
Del: spam -- https://master.php.net/note/delete/114944/spam
Del: non-english -- https://master.php.net/note/delete/114944/non-english
Del: in docs -- https://master.php.net/note/delete/114944/in+docs
Del: other reasons-- https://master.php.net/note/delete/114944
Reject -- https://master.php.net/note/reject/114944
Search -- https://master.php.net/manage/user-notes.php