# GrapeCity.Documents.Imaging.GcBitmap.ToIndexed8bppBitmap

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Imaging_GcBitmap_ToIndexed8bppBitmap_" data-uid="GrapeCity.Documents.Imaging.GcBitmap.ToIndexed8bppBitmap*">ToIndexed8bppBitmap Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Imaging_GcBitmap_ToIndexed8bppBitmap_" data-uid="GrapeCity.Documents.Imaging.GcBitmap.ToIndexed8bppBitmap*"></a>
<h4 id="GrapeCity_Documents_Imaging_GcBitmap_ToIndexed8bppBitmap_System_Int32_System_Boolean_" data-uid="GrapeCity.Documents.Imaging.GcBitmap.ToIndexed8bppBitmap(System.Int32,System.Boolean)">ToIndexed8bppBitmap(int, bool)</h4>
<div class="markdown level1 summary"><p>Creates an opaque <a class="xref" href="GrapeCity.Documents.Imaging.Indexed8bppBitmap.html">Indexed8bppBitmap</a> from the current image using the Octree quantizer algorithm.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Indexed8bppBitmap ToIndexed8bppBitmap(int maxColors, bool appendTransparentColor = false)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function ToIndexed8bppBitmap(maxColors As Integer, Optional appendTransparentColor As Boolean = False) As Indexed8bppBitmap</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">maxColors</span></td>
      <td><p>The maximum number of opaque colors in the palette, from 8 to 256.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">appendTransparentColor</span></td>
      <td><p>Indicates if a transparent color should be added to the palette, if the image is not opaque and the number of opaque colors is less than 256.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Imaging.Indexed8bppBitmap.html">Indexed8bppBitmap</a></td>
      <td><p>A new instance of <a class="xref" href="GrapeCity.Documents.Imaging.Indexed8bppBitmap.html">Indexed8bppBitmap</a>.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Documents_Imaging_GcBitmap_ToIndexed8bppBitmap_" data-uid="GrapeCity.Documents.Imaging.GcBitmap.ToIndexed8bppBitmap*"></a>
<h4 id="GrapeCity_Documents_Imaging_GcBitmap_ToIndexed8bppBitmap_System_UInt32___GrapeCity_Documents_Imaging_DitheringMethod_System_Boolean_" data-uid="GrapeCity.Documents.Imaging.GcBitmap.ToIndexed8bppBitmap(System.UInt32[],GrapeCity.Documents.Imaging.DitheringMethod,System.Boolean)">ToIndexed8bppBitmap(uint[], DitheringMethod, bool)</h4>
<div class="markdown level1 summary"><p>Creates an opaque <a class="xref" href="GrapeCity.Documents.Imaging.Indexed8bppBitmap.html">Indexed8bppBitmap</a> from the current image using the specified palette.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Indexed8bppBitmap ToIndexed8bppBitmap(uint[] palette, DitheringMethod ditheringMethod, bool appendTransparentColor = false)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function ToIndexed8bppBitmap(palette As UInteger(), ditheringMethod As DitheringMethod, Optional appendTransparentColor As Boolean = False) As Indexed8bppBitmap</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.uint32">uint</a>[]</td>
      <td><span class="parametername">palette</span></td>
      <td><p>The palette with opaque colors for the new image (colors are in 32-bit ARGB format). Elements with index 256 and above are ignored.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Imaging.DitheringMethod.html">DitheringMethod</a></td>
      <td><span class="parametername">ditheringMethod</span></td>
      <td><p>The method of two-dimensional error diffusion dithering.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">appendTransparentColor</span></td>
      <td><p>Indicates if a transparent color should be added to the palette, if the image is not opaque and the number of opaque colors is less than 256.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Imaging.Indexed8bppBitmap.html">Indexed8bppBitmap</a></td>
      <td><p>A new instance of <a class="xref" href="GrapeCity.Documents.Imaging.Indexed8bppBitmap.html">Indexed8bppBitmap</a>.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Documents_Imaging_GcBitmap_ToIndexed8bppBitmap_" data-uid="GrapeCity.Documents.Imaging.GcBitmap.ToIndexed8bppBitmap*"></a>
<h4 id="GrapeCity_Documents_Imaging_GcBitmap_ToIndexed8bppBitmap_GrapeCity_Documents_Imaging_DitheringMethod_" data-uid="GrapeCity.Documents.Imaging.GcBitmap.ToIndexed8bppBitmap(GrapeCity.Documents.Imaging.DitheringMethod)">ToIndexed8bppBitmap(DitheringMethod)</h4>
<div class="markdown level1 summary"><p>Creates an <a class="xref" href="GrapeCity.Documents.Imaging.Indexed8bppBitmap.html">Indexed8bppBitmap</a> from the current image.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public Indexed8bppBitmap ToIndexed8bppBitmap(DitheringMethod ditheringMethod)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function ToIndexed8bppBitmap(ditheringMethod As DitheringMethod) As Indexed8bppBitmap</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Imaging.DitheringMethod.html">DitheringMethod</a></td>
      <td><span class="parametername">ditheringMethod</span></td>
      <td><p>The method of two-dimensional error diffusion dithering.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="GrapeCity.Documents.Imaging.Indexed8bppBitmap.html">Indexed8bppBitmap</a></td>
      <td><p>A new instance of <a class="xref" href="GrapeCity.Documents.Imaging.Indexed8bppBitmap.html">Indexed8bppBitmap</a>.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
