[Gdal-dev] Creating a color geotiff

Frank Warmerdam warmerdam at pobox.com
Wed Jan 14 18:16:47 EST 2004


Andrey Kiselev wrote:
> On Wed, Jan 14, 2004 at 03:45:08PM -0500, Brian Marchand wrote:
> 
>>When I use the "create" function does the type need to match the type
>>that I use for the RasterIO function for a band? In this case both are
>>set to GDT_Byte. 
> 
> 
> As Ed said the problem is in the your viewer, which can't properly
> interpret your files. But your files also differs from the "true" RGB
> ones. The files created with GDAL has Photometric Interpretation
> "min-is-black" but "true" RGB file should set that tag as "RGB Image".
> It is not possible to set that value using GDAL because it is software
> to work with the complex multi band TIFFs, not only the simple one band
> grayscale images or three band RGB ones.
> 
> On other hand it is possible to implement the option flag for the
> Create() function to explicitly set the Photometric tag value, if it
> is really needed.

Folks,

GDAL is supposed to produce TIFF files with a photometric interpretation of
RGB if the band type is byte, and the number of bands is 3 or 4.  If this
isn't the case, let me know so I can fix it.  As Andrey notes, there are
situations where GDAL crates MINISBLACK files, even if they are 3 bands.
Basically if the band type is anything but byte.

Ideally we should add creation options to control the photometric interpretation
explicitly.  If you need it we can do that.

Best regards,

---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent





More information about the Gdal-dev mailing list