<?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 => 'en',
  ),
  'this' => 
  array (
    0 => 'function.imagesetinterpolation.php',
    1 => 'imagesetinterpolation',
    2 => 'Set the interpolation method',
  ),
  'up' => 
  array (
    0 => 'ref.image.php',
    1 => 'GD and Image Functions',
  ),
  'prev' => 
  array (
    0 => 'function.imagesetclip.php',
    1 => 'imagesetclip',
  ),
  'next' => 
  array (
    0 => 'function.imagesetpixel.php',
    1 => 'imagesetpixel',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/image/functions/imagesetinterpolation.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.imagesetinterpolation" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imagesetinterpolation</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.5.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">imagesetinterpolation</span> &mdash; <span class="dc-title">Set the interpolation method</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.imagesetinterpolation-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imagesetinterpolation</strong></span>(<span class="methodparam"><span class="type"><a href="class.gdimage.php" class="type GdImage">GdImage</a></span> <code class="parameter">$image</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$method</code><span class="initializer"> = <strong><code><a href="image.constants.php#constant.img-bilinear-fixed">IMG_BILINEAR_FIXED</a></code></strong></span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Sets the interpolation method, setting an interpolation method affects the rendering 
   of various functions in GD, such as the <span class="function"><a href="function.imagerotate.php" class="function">imagerotate()</a></span> function.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.imagesetinterpolation-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>
    <dt>
<code class="parameter">image</code></dt><dd><p class="para">A <span class="classname"><a href="class.gdimage.php" class="classname">GdImage</a></span> object, returned by one of the image creation functions,
such as <span class="function"><a href="function.imagecreatetruecolor.php" class="function">imagecreatetruecolor()</a></span>.</p></dd>
    
     <dt><code class="parameter">method</code></dt>
     <dd>
      <p class="para">
       The interpolation method, which can be one of the following:
       <ul class="itemizedlist">
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="image.constants.php#constant.img-bell">IMG_BELL</a></code></strong>: Bell filter.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="image.constants.php#constant.img-bessel">IMG_BESSEL</a></code></strong>: Bessel filter.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="image.constants.php#constant.img-bicubic">IMG_BICUBIC</a></code></strong>: Bicubic interpolation.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="image.constants.php#constant.img-bicubic-fixed">IMG_BICUBIC_FIXED</a></code></strong>: Fixed point implementation of the bicubic interpolation.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="image.constants.php#constant.img-bilinear-fixed">IMG_BILINEAR_FIXED</a></code></strong>: Fixed point implementation of the  bilinear interpolation (<code class="literal">default (also on image creation)</code>).
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="image.constants.php#constant.img-blackman">IMG_BLACKMAN</a></code></strong>: Blackman window function.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="image.constants.php#constant.img-box">IMG_BOX</a></code></strong>: Box blur filter.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="image.constants.php#constant.img-bspline">IMG_BSPLINE</a></code></strong>: Spline interpolation.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="image.constants.php#constant.img-catmullrom">IMG_CATMULLROM</a></code></strong>: Cubic Hermite spline interpolation.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="image.constants.php#constant.img-gaussian">IMG_GAUSSIAN</a></code></strong>: Gaussian function.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="image.constants.php#constant.img-generalized-cubic">IMG_GENERALIZED_CUBIC</a></code></strong>: Generalized cubic spline fractal interpolation.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="image.constants.php#constant.img-hermite">IMG_HERMITE</a></code></strong>: Hermite interpolation.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="image.constants.php#constant.img-hamming">IMG_HAMMING</a></code></strong>: Hamming filter.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="image.constants.php#constant.img-hanning">IMG_HANNING</a></code></strong>: Hanning filter.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="image.constants.php#constant.img-mitchell">IMG_MITCHELL</a></code></strong>: Mitchell filter.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="image.constants.php#constant.img-power">IMG_POWER</a></code></strong>: Power interpolation.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="image.constants.php#constant.img-quadratic">IMG_QUADRATIC</a></code></strong>: Inverse quadratic interpolation.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="image.constants.php#constant.img-sinc">IMG_SINC</a></code></strong>: Sinc function.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="image.constants.php#constant.img-nearest-neighbour">IMG_NEAREST_NEIGHBOUR</a></code></strong>: Nearest neighbour interpolation.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="image.constants.php#constant.img-weighted4">IMG_WEIGHTED4</a></code></strong>: Weighting filter.
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="image.constants.php#constant.img-triangle">IMG_TRIANGLE</a></code></strong>: Triangle interpolation.
         </span>
        </li>
       </ul>
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.imagesetinterpolation-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> on success or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.imagesetinterpolation-changelog">
  <h3 class="title">Changelog</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.0.0</td>
 <td>
  <code class="parameter">image</code> expects a <span class="classname"><a href="class.gdimage.php" class="classname">GdImage</a></span>
  instance now; previously, a valid <code class="literal">gd</code> <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> was expected.
 </td>
</tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.imagesetinterpolation-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 <span class="function"><strong>imagesetinterpolation()</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">// Load an image<br /></span><span style="color: #0000BB">$im </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecreate</span><span style="color: #007700">(</span><span style="color: #0000BB">500</span><span style="color: #007700">, </span><span style="color: #0000BB">500</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// By default interpolation is IMG_BILINEAR_FIXED, switch <br />// to use the 'Mitchell' filter:<br /></span><span style="color: #0000BB">imagesetinterpolation</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">IMG_MITCHELL</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Continue to work with $im ...<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.imagesetinterpolation-notes">
  <h3 class="title">Notes</h3>
  <p class="para">
   Changing the interpolation method affects the following functions 
   when rendering:

   <ul class="itemizedlist">
    <li class="listitem">
     <span class="simpara">
      <span class="function"><a href="function.imageaffine.php" class="function">imageaffine()</a></span>
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <span class="function"><a href="function.imagerotate.php" class="function">imagerotate()</a></span>
     </span>
    </li>
   </ul>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.imagesetinterpolation-seealso">
  <h3 class="title">See Also</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.imagegetinterpolation.php" class="function" rel="rdfs-seeAlso">imagegetinterpolation()</a> - Get the interpolation method</span></li>
  </ul>
 </div>


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