[Gdal-dev] Where'd all my colors go? (gdal_translate)

Frank Warmerdam fwarmerdam at gmail.com
Fri Dec 3 02:48:06 EST 2004


On Thu, 2 Dec 2004 16:57:27 -0700, Ethan Alpert
<ealpert at digitalglobe.com> wrote:
> 
> So I just wanted to reduce the resolution of a NTF file I have by 50%.
> Naively I just ran gdal_translate:
> 
> -bash-2.05b$ gdal_translate -outsize 50% 50%
> 02SEP19145640-M2AS-000001200012_01_P001.NTF
> 02SEP19145640-M2AS-000001200012_01_P001_50%.NTF


Ethan,

There are a couple problems with this.  First, since you didn't
specify an output format, it wrote a GeoTIFF file (the default). 
The GeoTIFF format driver does not currently support writing
16bit files with RGB photometric interpretation.  So the photometric
interpretation just gets changed to minisblack which comes through
as undefined I believe. 

You could try requesting the data be written to NITF format using
the -of NITF flags, but I am not convinced that the photometric
interpretation will be properly maintained. 

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