<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.image.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'function.imagecolormatch.php',
    1 => 'imagecolormatch',
    2 => 'Makes the colors of the palette version of an image more closely match the true color version',
  ),
  'up' => 
  array (
    0 => 'ref.image.php',
    1 => 'Функції GD та Image',
  ),
  'prev' => 
  array (
    0 => 'function.imagecolorexactalpha.php',
    1 => 'imagecolorexactalpha',
  ),
  'next' => 
  array (
    0 => 'function.imagecolorresolve.php',
    1 => 'imagecolorresolve',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/image/functions/imagecolormatch.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.imagecolormatch" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imagecolormatch</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.3.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">imagecolormatch</span> &mdash; <span class="dc-title">Makes the colors of the palette version of an image more closely match the true color version</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.imagecolormatch-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imagecolormatch</strong></span>(<span class="methodparam"><span class="type"><a href="class.gdimage.php" class="type GdImage">GdImage</a></span> <code class="parameter">$image1</code></span>, <span class="methodparam"><span class="type"><a href="class.gdimage.php" class="type GdImage">GdImage</a></span> <code class="parameter">$image2</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Makes the colors of the palette version of an image more closely match the true color version.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.imagecolormatch-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">image1</code></dt>
     <dd>
      <p class="para">
       A truecolor image object.
      </p>
     </dd>
    
    
     <dt><code class="parameter">image2</code></dt>
     <dd>
      <p class="para">
       A palette image object pointing to an image that has the same
       size as <code class="parameter">image1</code>.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.imagecolormatch-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   Повертає <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> у разі успіху або <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> в разі помилки.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.imagecolormatch-changelog">
  <h3 class="title">Журнал змін</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Версія</th>
      <th>Опис</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">image1</code> and <code class="parameter">image2</code> expect
       <span class="classname"><a href="class.gdimage.php" class="classname">GdImage</a></span> instances now; previously, <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span>s
       were expected.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.imagecolormatch-examples">
  <h3 class="title">Приклади</h3>
  <div class="example" id="example-1">
   <p><strong>Приклад #1 <span class="function"><strong>imagecolormatch()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">// Setup the true color and palette images<br /></span><span style="color: #0000BB">$im1 </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecreatefrompng</span><span style="color: #007700">(</span><span style="color: #DD0000">'./gdlogo.png'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$im2 </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecreate</span><span style="color: #007700">(</span><span style="color: #0000BB">imagesx</span><span style="color: #007700">(</span><span style="color: #0000BB">$im1</span><span style="color: #007700">), </span><span style="color: #0000BB">imagesy</span><span style="color: #007700">(</span><span style="color: #0000BB">$im1</span><span style="color: #007700">));<br /><br /></span><span style="color: #FF8000">// Add some colors to $im2<br /></span><span style="color: #0000BB">$colors   </span><span style="color: #007700">= Array();<br /></span><span style="color: #0000BB">$colors</span><span style="color: #007700">[] = </span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$im2</span><span style="color: #007700">, </span><span style="color: #0000BB">255</span><span style="color: #007700">, </span><span style="color: #0000BB">36</span><span style="color: #007700">, </span><span style="color: #0000BB">74</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$colors</span><span style="color: #007700">[] = </span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$im2</span><span style="color: #007700">, </span><span style="color: #0000BB">40</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">240</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$colors</span><span style="color: #007700">[] = </span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$im2</span><span style="color: #007700">, </span><span style="color: #0000BB">82</span><span style="color: #007700">, </span><span style="color: #0000BB">100</span><span style="color: #007700">, </span><span style="color: #0000BB">255</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$colors</span><span style="color: #007700">[] = </span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$im2</span><span style="color: #007700">, </span><span style="color: #0000BB">84</span><span style="color: #007700">, </span><span style="color: #0000BB">63</span><span style="color: #007700">, </span><span style="color: #0000BB">44</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Match these colors with the true color image<br /></span><span style="color: #0000BB">imagecolormatch</span><span style="color: #007700">(</span><span style="color: #0000BB">$im1</span><span style="color: #007700">, </span><span style="color: #0000BB">$im2</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.imagecolormatch-seealso">
  <h3 class="title">Прогляньте також</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.imagecreatetruecolor.php" class="function" rel="rdfs-seeAlso">imagecreatetruecolor()</a> - Create a new true color image</span></li>
  </ul>
 </div>

</div><?php manual_footer($setup); ?>