<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->

<refentry xml:id="gmagick.quantizeimages" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>Gmagick::quantizeimages</refname>
  <refpurpose>The quantizeimages purpose</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <modifier>public</modifier> <type>Gmagick</type><methodname>Gmagick::quantizeimages</methodname>
   <methodparam><type>int</type><parameter>numColors</parameter></methodparam>
   <methodparam><type>int</type><parameter>colorspace</parameter></methodparam>
   <methodparam><type>int</type><parameter>treeDepth</parameter></methodparam>
   <methodparam><type>bool</type><parameter>dither</parameter></methodparam>
   <methodparam><type>bool</type><parameter>measureError</parameter></methodparam>
  </methodsynopsis>
  <para>
   Analyzes the colors within a sequence of images and chooses a fixed number of 
   colors to represent the image. The goal of the algorithm is to minimize the 
   color difference between the input and output image while minimizing the processing time.
  </para>

   

 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>numColors</parameter></term>
     <listitem>
      <para>
       The number of colors.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>colorspace</parameter></term>
     <listitem>
      <para>
       Perform color reduction in this colorspace, typically RGBColorspace.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>treeDepth</parameter></term>
     <listitem>
      <para>
       Normally, this integer value is zero or one. A zero or one tells Quantize 
to choose a optimal tree depth of Log4(number_colors).% A tree of this depth generally 
allows the best representation of the reference image with the least amount of memory
 and the fastest computational speed. In some cases, such as an image with low color
 dispersion (a few number of colors), a value other than Log4(number_colors) is required. 
To expand the color tree completely, use a value of 8.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>dither</parameter></term>
     <listitem>
      <para>
       A value other than zero distributes the difference between an original image and the corresponding color reduced algorithm to neighboring pixels along a Hilbert curve.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>measureError</parameter></term>
     <listitem>
      <para>
       A value other than zero measures the difference between the original and quantized images. This difference is the total quantization error. The error is computed by summing over all pixels in an image the distance squared in RGB space between each reference pixel value and its quantized value.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   The Gmagick object on success
  </para>
 </refsect1>

  <refsect1 role="errors">
  &reftitle.errors;
  <para>
   &gmagick.gmagickexception.throw;
  </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
-->
