[gdal-dev] Set color table in NITF
even.rouault at mines-paris.org
Mon Aug 29 18:29:30 EDT 2011
Le mardi 30 août 2011 00:14:12, Cole, Derek a écrit :
> I am trying to create a NITF that uses a color lookup table.
> I found the option to add an RGB/LUT to the image, which didnt complain,
> however, when I had my LUT data to the image, it all seems to be kind of
> black and white.
> I know when I was displaying the images in my viewer (which I wrote in Qt),
> I had a function to create a 256 element color table, that changed some of
> the values. How would I modify the color table in the NITF?
Use SetColorTable() on the raster band object.
Python example :
from osgeo import gdal
ds = gdal.GetDriverByName('NITF').Create('test.ntf', 1, 1, options =
ct = gdal.ColorTable()
ct.SetColorEntry( 0, (0,0,0) )
ct.SetColorEntry( 1, (10,10,10) )
ct.SetColorEntry( 2, (20, 20, 20))
ds = None
$ gdalinfo test.ntf
Driver: NITF/National Imagery Transmission Format
Size is 1, 1
Band 1 Block=1x1 Type=Byte, ColorInterp=Palette
Color Table (RGB with 4 entries)
More information about the gdal-dev