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

Flavio Hendry flavio at tydac.ch
Mon Jun 16 08:32:08 EDT 2003


Hi Twan

I had the same problem using 4-bit TIFF (they displayed but it took 
ages) and 4-bit GIF (the system ran out of memory!). Just converted 
them to 8-bit and it was fine ...

best regards
flavio

----------------------------------------------------------------
############      Mit freundlichen Gruessen / Best Regards
############       Flavio Hendry- mailto:flavio at tydac.ch
############         TYDAC AG - http://www.tydac.ch
####    ####        Geographic Information Solutions
####    ####         Luternauweg 12 -- CH-3006 Bern
############   Tel +41 (0)31 368 0180 - Fax +41 (0)31 368 1860
----------------------------------------------------------------

-----Original Message-----
From: Twan Kogels <twan at twansoft.com>
To: mapserver-users at lists.gis.umn.edu
Date: Mon, 16 Jun 2003 10:46:48 +0200
Subject: [Mapserver-users] 16 color tiffs don't display correctly

> 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
> 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users




More information about the mapserver-users mailing list