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 "RGB-Undefined" 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"><<a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>></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 <<a href="mailto:nmayer31000@gmail.com">nmayer31000@gmail.com</a>>:<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'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>
> Hello<br>
><br>
> I have a problem with the geotiff (GTiff) driver.<br>
><br>
> I create a 4-bands raster image in a c++ program. The fourth band was<br>
> considered as an alpha band in the geotiff image (actually, it is near<br>
> infrared : NIR)<br>
><br>
> $ gdalinfo new_geotiff.tif<br>
> Driver: GTiff/GeoTIFF<br>
> Files: new__geotiff.tif<br>
> Size is 100, 100<br>
> (...)<br>
> Band 1 Block=100x20 Type=Byte, ColorInterp=Red<br>
> Mask Flags: PER_DATASET ALPHA<br>
> Band 2 Block=100x20 Type=Byte, ColorInterp=Green<br>
> Mask Flags: PER_DATASET ALPHA<br>
> Band 3 Block=100x20 Type=Byte, ColorInterp=Blue<br>
> Mask Flags: PER_DATASET ALPHA<br>
> Band 4 Block=100x20 Type=Byte, ColorInterp=Alpha<br>
><br>
> How to remove the Color interpretation 'alpha' and the mask flags ?<br>
><br>
> I want to have :<br>
><br>
> Band 1 Block=100x20 Type=Byte, ColorInterp=Red<br>
> Band 2 Block=100x20 Type=Byte, ColorInterp=Green<br>
> Band 3 Block=100x20 Type=Byte, ColorInterp=Blue<br>
> Band 4 Block=100x20 Type=Byte, ColorInterp=Undefined<br>
><br>
> I already tryed :<br>
> pDS->GetRasterBand(4)->SetColorInterpretation(GCI_Undefined );<br>
><br>
> I tryed too to set the creation option : "ALPHA" to "NO".<br>
><br>
><br>
> Thanks in advance for any help.<br>
><br>
> Nicky<br>
><br>
<br>
<br>
</div></div></blockquote></div><br>