[Gdal-dev] gdal_merge.py Gtiff files with -pct losing color

Joaquim Luis jluis at ualg.pt
Wed Dec 6 16:32:13 EST 2006


Matt Wilkie wrote:
>> There is nothing wrong with GDAL. What happens is that the file has a
>>  color palette with only zeros. So naturally it comes up as a black
>> image.
>
> Then why do other programs like ossim, xnview, and imagemagick display
> it properly? With xnview I can view and modify the colour pallette.
>

Mystery.
The default Windows viewer ("picture and fax previewer") also displays 
it correctly.
But Matlab is on the "black team". And it see the colormap like this

0.0039    0.0039    0.0039
0    0    0
0    0    0.0013
0    0    0.0026
...

With a maximum of 0.0039. If I normalize this colormap (devided it by 
0.0039) than also
Matlab displays it properly.
Probably, that's what the others do as well.


Joaquim Luis




More information about the Gdal-dev mailing list