Php/docs/imagick.compareimages

提供:Dev Guides
< Php
移動先:案内検索

Imagick::compareImages

(PECL imagick 2, PECL imagick 3)

Imagick::compareImagesある画像を再構築された画像と比較する


説明

public Imagick::compareImages ( Imagick $compare , int $metric ) : array

再構築された画像と画像の差異を含む配列を返します。


パラメータ

compare
比較したい画像。
metric
メトリック定数を指定します。この メトリック定数 の一覧を参照ください。


返り値

再構築された画像と画像の差異を含む配列を返します。


エラー / 例外

エラー時に ImagickException をスローします。


例1 Imagick::compareImages() の使用法

画像を比較し、再構築された画像を表示します。


<?php$image1 = new imagick("image1.png");$image2 = new imagick("image2.png");$result = $image1->compareImages($image2, Imagick::METRIC_MEANSQUAREERROR);$result[0]->setImageFormat("png");header("Content-Type: image/png");echo $result[0];?>