Hi all,<br>
<br>
I'm writing a plugin using GDAL C library to allow the user to create a grayscale GeoTiff with transparency.<br><br>I've used the following code to init the raster:<br><br>Driver = GDALGetDriverByName("GTiff");    <br>


<br>papszOptions = CSLSetNameValue(papszOptions, "COMPRESS", "LZW");<br><br>Dataset = GDALCreate(Driver, SrcFilename, XSize, YSize, 2, GDT_Byte, papszOptions);<br><br>Band1 = GDALGetRasterBand(Dataset, 1);<br clear="all">



GDALSetRasterColorInterpretation(Band1, GCI_GrayIndex);     <br><br>Band2 = GDALGetRasterBand(Dataset, 2);<br>GDALSetRasterColorInterpretation(Band2, GCI_AlphaBand);<br><br>...<br>Init the two bands<br>...<br><br><br>The result is a correct grayscale image but without transparency.<br>

<br>
Can someone point me a way to create a grayscale GeoTiff with a transparency?<br><br>Thank you very much.<br>
<br>
Pietro<br>
<br clear="all"><br>-- <br>Pietro Panzeri<br><br>Software Development Manager<br><br>Tele-Rilevamento Europa - T.R.E. srl<br>Via Vittoria Colonna, 7<br>20149 Milano – Italia<br>Tel.: +39.02.4343.121 - Fax: +39.02.4343.1230<br>


<a href="mailto:pietro.panzeri@treuropa.com" target="_blank">pietro.panzeri@treuropa.com</a> - <a href="http://www.treuropa.com" target="_blank">www.treuropa.com</a><br>