[Mapserver-users] 16 color tiffs don't display correctly
Twan Kogels
twan at twansoft.com
Mon Jun 16 06:37:05 PDT 2003
Hello Frank and Flavio,
Thanks for the clear explanation. I have downloaded and compiled
ImageMagick and ran "mogrify -colors 256 *.TIF", this converts * tiff to
256 colors. After a little waiting i started mapserver and the maps
displayed correct as aspected.
Best regards,
Twan
At 09:06 16-6-2003 -0400, you wrote:
>Twan Kogels wrote:
>>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
>...
>>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
>
>Twan,
>
>The issue here for GDAL is that it uses the generic "convert to
>32bit RGBA" logic in libtiff for some more esoteric styles of TIFF
>file, including files with 2-7 bits per pixel. In this case I presume
>your 16 color file is a 4bit TIFF image.
>
>When converted t 24bit, and then back to 8bit for final display through
>mapserver some colors are lost in the 24bit->8bit color compression
>logic. Overall performance suffers because of the extra work expanding
>and recompressing the data.
>
>I could add futher special cases to GDAL (as I have done for 1 bit) to
>handle 2 bit and 4 bit TIFF files, but in this situation you are likely
>just as well off to expand the file to 8bit yourself using external
>tools.
>
>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
>
>
>_______________________________________________
>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