[Mapserver-users] 16 color tiffs don't display correctly

Twan Kogels twan at twansoft.com
Mon Jun 16 04:46:48 EDT 2003


Hello,

I've managed to let mapserver display a couple of tiff files at 1:1 
resolution so no distortion (from resample or resize) occur. But i have a 
problem with displaying tiff files with only 16 colors:
==============
Driver: GTiff/GeoTIFF
Size is 1778, 1185
Coordinate System is `'
Metadata:
   TIFFTAG_SOFTWARE=Handmade Software, Inc. Image Alchemy v1.7.7
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0, 1185.0)
Upper Right ( 1778.0,    0.0)
Lower Right ( 1778.0, 1185.0)
Center      (  889.0,  592.5)
Band 1 Block=1778x8 Type=Byte, ColorInterp=Red
Band 2 Block=1778x8 Type=Byte, ColorInterp=Green
Band 3 Block=1778x8 Type=Byte, ColorInterp=Blue
Band 4 Block=1778x8 Type=Byte, ColorInterp=Alpha
==============

The one with 256 colors displays fine (converted with psp8):
==============
Driver: GTiff/GeoTIFF
Size is 1778, 1185
Coordinate System is `'
Origin = (143979.750000,336020.250000)
Pixel Size = (40.500000,-40.500000)
Metadata:
   TIFFTAG_SOFTWARE=Handmade Software, Inc. Image Alchemy v1.7.7
Corner Coordinates:
Upper Left  (  143979.750,  336020.250)
Lower Left  (  143979.750,  288027.750)
Upper Right (  215988.750,  336020.250)
Lower Right (  215988.750,  288027.750)
Center      (  179984.250,  312024.000)
Band 1 Block=1778x8 Type=Byte, ColorInterp=Palette
   Color Table (RGB with 256 entries)
     0: 0,0,0,255
     1: 38,38,38,255
     2: 84,84,84,255
     3: 127,127,127,255
     4: 168,168,168,255
     5: 232,232,208,255
     6: 255,0,0,255
     7: 0,0,255,255
     8: 255,255,0,255
     9: 255,0,255,255
    10: 181,255,84,255
    11: 145,181,84,255
    12: 160,200,255,255
    13: 255,166,89,255
    14: 255,110,255,255
    15: 255,255,255,255
....(more)...
==============

I've uploaded a example to visualize the error:
<http://spirit.ict-link.nl/~twan/bin/img1.gif>
On this image you see a map seperated by a black line, at the top of the 
black line there is a tiff file with 16 colors and at the bottom of the 
black line is a tiff file with 256 colors. When creating this example i did 
not use the "--without-tiff" option to compile mapserver:

==============
./configure --with-gd --with-tiff --with-jpg --with-png --with-proj 
--with-ogr --with-gdal --with-postgis --with-php=/usr/local/src/php-4.3.1/
==============

After searching the mailinglist i found that it maybe a solution to use the 
"--without-tiff" option to compile mapserver, so that "gdal" will handle 
the reading of the tiff files. So i recompiled mapserver:

==============
./configure --with-gd --without-tiff --with-jpg --with-png --with-proj 
--with-ogr --with-gdal --with-postgis --with-php=/usr/local/src/php-4.3.1/
==============

The result is better, but there are a couple of minor points. Some colors 
seem to disappear when displaying tiffs, a example:
<http://spirit.ict-link.nl/~twan/bin/img2.gif>
As you can see the brown color has disappeared from the tiff file with 16 
colors (the top one).

I also noticed a performance decrease from over 100% for small maps to over 
400% for big overview maps (overview map at total of 5mb with 23 tiles)

Is there a solution on how to display 16 color tiffs correctly with 
mapserver, or should i write a batch file which converts all my maps to 256 
colors?

Best regards,
Twan Kogels




More information about the mapserver-users mailing list