Even, thank you very much for answering me so quicly<br>
<br>
With the PHOTOMETRIC creation option to MINISBLACK, I get now :<br>
Band 1 Block=100x20 Type=Byte, ColorInterp=Gray<br>
Band 2 Block=100x20 Type=Byte, ColorInterp=Undefined<br>
Band 3 Block=100x20 Type=Byte, ColorInterp=Undefined<br>
Band 4 Block=100x20 Type=Byte, ColorInterp=Undefined<br>
<br>
Does this option change anything in the metadatas or in the headers of the written file ?<br>
<br>
But I try to make the same thing as an exemple file I have, which has this interpretation whith gdalinfo (GDAL 1.7.3) :<br>
<br>
Metadata:<br>
  TIFFTAG_IMAGEDESCRIPTION=B3 B2 B1 B4 <br>
  TIFFTAG_DATETIME=20050824 18:08:22  <br>
  AREA_OR_POINT=Point<br>
Image Structure Metadata:<br>
  INTERLEAVE=BAND<br>
Corner Coordinates:<br>
Upper Left  (    0.0,    0.0)<br>
Lower Left  (    0.0, 3000.0)<br>
Upper Right ( 3000.0,    0.0)<br>
Lower Right ( 3000.0, 3000.0)<br>
Center      ( 1500.0, 1500.0)<br>
Band 1 Block=3000x500 Type=Byte, ColorInterp=Red<br>
Band 2 Block=3000x500 Type=Byte, ColorInterp=Green<br>
Band 3 Block=3000x500 Type=Byte, ColorInterp=Blue<br>
Band 4 Block=3000x500 Type=Byte, ColorInterp=Undefined<br>
<br>
My goal is to have an &quot;RGB-Undefined&quot; color interpretation.<br>Have you any idea of the creation option (or driver option ?) to set to have the same color interpretations ?<br>
<br>
Thank you in advance<br>
<br>
Nicky<br>
<br><br><br><div class="gmail_quote">2011/4/18 Even Rouault <span dir="ltr">&lt;<a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

Selon Nicolas Mayer &lt;<a href="mailto:nmayer31000@gmail.com">nmayer31000@gmail.com</a>&gt;:<br>
<br>
Retry by setting the PHOTOMETRIC creation option to MINISBLACK. Otherwise, by<br>
default, without specifying it, GDAL assumes that the PHOTOMETRIC is RGB and<br>
that the 4th band is an alpha band.<br>
<br>
You should get :<br>
Band 1 Block=100x20 Type=Byte, ColorInterp=Gray<br>
Band 2 Block=100x20 Type=Byte, ColorInterp=Undefined<br>
Band 3 Block=100x20 Type=Byte, ColorInterp=Undefined<br>
<div class="im">Band 4 Block=100x20 Type=Byte, ColorInterp=Undefined<br>
<br>
</div>There&#39;s no way in the TIFF format to really specify the color interpretation of<br>
each band. The way GDAL builds the color interpretation when reading a TIFF file<br>
is a combination of the value of the PHOTOMETRIC and EXTRASAMPLES tag.<br>
<div><div></div><div class="h5"><br>
&gt; Hello<br>
&gt;<br>
&gt; I have a problem with the geotiff (GTiff) driver.<br>
&gt;<br>
&gt; I create a 4-bands raster image in a c++ program. The fourth band was<br>
&gt; considered as an alpha band in the geotiff image (actually, it is near<br>
&gt; infrared : NIR)<br>
&gt;<br>
&gt; $ gdalinfo new_geotiff.tif<br>
&gt; Driver: GTiff/GeoTIFF<br>
&gt; Files: new__geotiff.tif<br>
&gt; Size is 100, 100<br>
&gt; (...)<br>
&gt; Band 1 Block=100x20 Type=Byte, ColorInterp=Red<br>
&gt;   Mask Flags: PER_DATASET ALPHA<br>
&gt; Band 2 Block=100x20 Type=Byte, ColorInterp=Green<br>
&gt;   Mask Flags: PER_DATASET ALPHA<br>
&gt; Band 3 Block=100x20 Type=Byte, ColorInterp=Blue<br>
&gt;   Mask Flags: PER_DATASET ALPHA<br>
&gt; Band 4 Block=100x20 Type=Byte, ColorInterp=Alpha<br>
&gt;<br>
&gt; How to remove the Color interpretation &#39;alpha&#39; and the mask flags ?<br>
&gt;<br>
&gt; I want to have :<br>
&gt;<br>
&gt; Band 1 Block=100x20 Type=Byte, ColorInterp=Red<br>
&gt; Band 2 Block=100x20 Type=Byte, ColorInterp=Green<br>
&gt; Band 3 Block=100x20 Type=Byte, ColorInterp=Blue<br>
&gt; Band 4 Block=100x20 Type=Byte, ColorInterp=Undefined<br>
&gt;<br>
&gt; I already tryed :<br>
&gt; pDS-&gt;GetRasterBand(4)-&gt;SetColorInterpretation(GCI_Undefined );<br>
&gt;<br>
&gt; I tryed too to set the creation option : &quot;ALPHA&quot; to &quot;NO&quot;.<br>
&gt;<br>
&gt;<br>
&gt; Thanks in advance for any help.<br>
&gt;<br>
&gt; Nicky<br>
&gt;<br>
<br>
<br>
</div></div></blockquote></div><br>