<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="imagick.compareimages">
 <refnamediv>
  <refname>Imagick::compareImages</refname>
  <refpurpose>Compares an image to a reconstructed image</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <modifier>public</modifier> <type>array</type><methodname>Imagick::compareImages</methodname>
   <methodparam><type>Imagick</type><parameter>compare</parameter></methodparam>
   <methodparam><type>int</type><parameter>metric</parameter></methodparam>
  </methodsynopsis>
  <para>
   Returns an array containing a reconstructed image and the difference between images.
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>compare</parameter></term>
     <listitem>
      <para>
       An image to compare to.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>metric</parameter></term>
     <listitem>
      <para>
       Provide a valid metric type constant. Refer to this
       list of  <link linkend="imagick.constants.metric">metric constants</link>.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>

 </refsect1>
 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Returns an array containing a reconstructed image and the difference between images.
  </para>
 </refsect1>

 <refsect1 role="errors">
  &reftitle.errors;
  <para>
   &imagick.imagick.throws;
  </para>
 </refsect1>

 <refsect1 role="examples">
  &reftitle.examples;
  <para>
   <example>
    <title>Using <function>Imagick::compareImages</function>:</title>
    <para>
     Compare images and display the reconstructed image
    </para>
    <programlisting role="php">
<![CDATA[
<?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];

?>
]]>
    </programlisting>
   </example>
  </para>
 </refsect1>

</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
