function.imagick-compareimages.html

来自「php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容」· HTML 代码 · 共 118 行

HTML
118
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Compares an image to a reconstructed image</title>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.imagick-compareimagelayers.html">Imagick::compareImageLayers</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.imagick-compositeimage.html">Imagick::compositeImage</a></div> <div class="up"><a href="class.imagick.html">The Imagick class</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.imagick-compareimages" class="refentry"> <div class="refnamediv">  <h1 class="refname">Imagick::compareImages</h1>  <p class="verinfo">(No version information available, might be only in CVS)</p><p class="refpurpose"><span class="refname">Imagick::compareImages</span> &mdash; <span class="dc-title">Compares an image to a reconstructed image</span></p> </div> <div class="refsect1 description">  <h3 class="title">Description</h3>  <div class="methodsynopsis dc-description">   <span class="type">array</span> <span class="methodname"><b><b>Imagick::compareImages</b></b></span>    ( <span class="methodparam"><span class="type"><a href="class.imagick.html" class="type Imagick">Imagick</a></span> <tt class="parameter">$compare</tt></span>   , <span class="methodparam"><span class="type">int</span> <tt class="parameter">$metric</tt></span>   )</div>  <div class="warning"><b class="warning">Warning</b><p class="simpara">This function iscurrently not documented; only its argument list is available.</p></div>  <p class="para">   Returns an array containing a reconstructed image and the difference between images.  </p> </div> <div class="refsect1 parameters">  <h3 class="title">Parameters</h3>  <p class="para">   <dl>    <dt>     <span class="term"><i><tt class="parameter">compare</tt></i></span>     <dd>      <p class="para">       An image to compare to.      </p>     </dd>    </dt>    <dt>     <span class="term"><i><tt class="parameter">metric</tt></i></span>     <dd>      <p class="para">       Provide a valid metric type constant. Refer to this       list of  <a href="imagick.constants.html#imagick.constants.metric" class="link">metric constants</a>.      </p>     </dd>    </dt>   </dl>  </p> </div> <div class="refsect1 returnvalues">  <h3 class="title">Return Values</h3>  <p class="para">   Returns <b><tt>TRUE</tt></b> on success.  </p> </div> <div class="refsect1 errors">  <h3 class="title">Errors/Exceptions</h3>  <p class="para">   Throws ImagickException on error.  </p> </div> <div class="refsect1 examples">  <h3 class="title">Examples</h3>  <p class="para">   <div class="example">    <p><b>Example #1 Using <b>Imagick::compareImages()</b>:</b></p>    <div class="example-contents"><p>     Compare images and display the reconstructed image    </p></div>    <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br />$image1&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">imagick</span><span style="color: #007700">(</span><span style="color: #DD0000">"image1.png"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$image2&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">imagick</span><span style="color: #007700">(</span><span style="color: #DD0000">"image2.png"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$image1</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">compareImages</span><span style="color: #007700">(</span><span style="color: #0000BB">$image2</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">Imagick</span><span style="color: #007700">::</span><span style="color: #0000BB">METRIC_MEANSQUAREERROR</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$result</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">]-&gt;</span><span style="color: #0000BB">setImageFormat</span><span style="color: #007700">(</span><span style="color: #DD0000">"png"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">"Content-Type:&nbsp;image/png"</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #0000BB">$result</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">];<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>    </div>   </div>  </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.imagick-compareimagelayers.html">Imagick::compareImageLayers</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.imagick-compositeimage.html">Imagick::compositeImage</a></div> <div class="up"><a href="class.imagick.html">The Imagick class</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?