# GrapeCity.Documents.Imaging.GcBitmap.GenerateOctreePalette

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Imaging_GcBitmap_GenerateOctreePalette_" data-uid="GrapeCity.Documents.Imaging.GcBitmap.GenerateOctreePalette*">GenerateOctreePalette Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Imaging_GcBitmap_GenerateOctreePalette_" data-uid="GrapeCity.Documents.Imaging.GcBitmap.GenerateOctreePalette*"></a>
<h4 id="GrapeCity_Documents_Imaging_GcBitmap_GenerateOctreePalette_System_Int32_System_Boolean_" data-uid="GrapeCity.Documents.Imaging.GcBitmap.GenerateOctreePalette(System.Int32,System.Boolean)">GenerateOctreePalette(int, bool)</h4>
<div class="markdown level1 summary"><p>Generates a palette for the image using the Octree quantizer algorithm.</p>
<p>The Alpha color channel is ignored.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public uint[] GenerateOctreePalette(int maxColors, bool skipTransparentPixels = false)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function GenerateOctreePalette(maxColors As Integer, Optional skipTransparentPixels As Boolean = False) As UInteger()</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 and above.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">skipTransparentPixels</span></td>
      <td><p>Indicates if the pixels with value of alpha less than 128 shouldn't be taken into account.</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="https://learn.microsoft.com/dotnet/api/system.uint32">uint</a>[]</td>
      <td><p>The resulting array with palette colors.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
