<!-- This comment will put IE 6, 7 and 8 in quirks mode --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>rgb2pct.py</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javaScript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body onload='searchBox.OnSelectItem(0);'> <!-- Generated by Doxygen 1.6.2-20100208 --> <script type="text/javascript"><!-- var searchBox = new SearchBox("searchBox", "search",false,'Search'); --></script> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li class="current"><a href="pages.html"><span>Related Pages</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <img id="MSearchSelect" src="search/search.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </div> </li> </ul> </div> </div> <div class="contents"> <h1><a class="anchor" id="rgb2pct">rgb2pct.py </a></h1><p>Convert a 24bit RGB image to 8bit paletted</p> <h2><a class="anchor" id="rsynopsis"> SYNOPSIS</a></h2> <div class="fragment"><pre class="fragment"> rgb2pct.py [-n colors] [-of format] source_file dest_file </pre></div><h2><a class="anchor" id="rdescription"> DESCRIPTION</a></h2> <p>This utility will compute an optimal pseudo-color table for a given RGB image using a median cut algorithm on a downsampled RGB histogram. Then it converts the image into a pseudo-colored image using the color table. This conversion utilizes Floyd-Steinberg dithering (error diffusion) to maximize output image visual quality.</p> <dl> <dt><b>-n</b> <em>colors</em>:</dt> <dd>Select the number of colors in the generated color table. Defaults to 256. Must be between 2 and 256. </dd> <dt><b>-of</b> <em>format</em>:</dt> <dd>Format to generated (defaults to GeoTIFF). Same semantics as the <b>-of</b> flag for gdal_translate. Only output formats supporting pseudocolor tables should be used. </dd> <dt><em>source_file</em>:</dt> <dd>The input RGB file. </dd> <dt><em>dest_file</em>:</dt> <dd>The output pseudo-colored file that will be created. </dd> </dl> <p>NOTE: rgb2pct.py is a Python script, and will only work if GDAL was built with Python support. </p> </div> <!--- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <hr> Generated for GDAL by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.6.2-20100208. </body> </html>