I'm on it.<br><br><div class="gmail_quote">On Mon, Feb 1, 2010 at 5:16 PM, Jan Hartmann <span dir="ltr"><<a href="mailto:j.l.h.hartmann@uva.nl">j.l.h.hartmann@uva.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Frank, could this be added to the documentation?<br><font color="#888888">
<br>
Jan</font><div><div></div><div class="h5"><br>
<br>
On 1-2-2010 12:37, Frank Warmerdam wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Luuk Schaminee wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
I am trying to convert a 24 bit RGB TIFF file to a 8 bit TIFF file. Without the –pct option this works perfectly but I want to control the created colors with a palette file. So I tried the following command:<br>
rgb2pct -pct c:\color_file.txt c:\image.tif e:\new_image.tif.<br>
</blockquote>
...<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
So now my question. What format must the palette file be in? and can you give me a working example.<br>
</blockquote>
<br>
Luuk,<br>
<br>
The palette must be in a GDAL supported raster file format (ie. TIFF,<br>
PNG, GIF, etc). Likely the easiest format for you to prepare manually<br>
would be VRT format. The following VRT is one with a small color table<br>
and no actual raster data:<br>
<br>
<br>
<VRTDataset rasterXSize="226" rasterYSize="271"><br>
<Metadata/><br>
<VRTRasterBand dataType="Byte" band="1"><br>
<ColorInterp>Palette</ColorInterp><br>
<ColorTable><br>
<Entry c1="238" c2="238" c3="238" c4="255"/><br>
<Entry c1="237" c2="237" c3="237" c4="255"/><br>
<Entry c1="236" c2="236" c3="236" c4="255"/><br>
<Entry c1="229" c2="229" c3="229" c4="255"/><br>
</ColorTable><br>
</VRTRasterBand><br>
</VRTDataset><br>
<br>
The c1/c2/c3/c4 entries are the red, green, blue and alpha components<br>
of color entries. You can have up to 256 entries in a normal file.<br>
<br>
Best regards,<br>
</blockquote></div></div><div><div></div><div class="h5">
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Chaitanya kumar CH.<br>/tʃaɪθənjə/ /kʊmɑr/ <br>+91-9848167848<br>17.241582N 80.142635E<br>