[Mapserver-users] tiffs and 256 colors

Dylan Keon keon at nacse.org
Thu Mar 6 13:01:11 PST 2003


Ok, I found the problem.  The Imagemagick 'convert' command is not 
actually reducing the color depth of my grayscale tiff image (see 
below...note file sizes).  Lowell also confirmed this.  I'm a bit 
surprised that convert can't do this, but maybe there's a good reason 
for it?

Anyway, I used Irfanview to reduce the color depth of the grayscale 
hillshade tiff, and it worked great.  Now I can display the colored DRG 
tiff on top of the hillshade using 8-bit output, no problem.

Thanks Lowell and Ed for your replies.

Dylan


#> convert -colors 64 hs256.tif hs64.tif
convert: unknown field with tag 34735 (0x87af) ignored. (hs256.tif).

#> identify hs256.tif
identify: unknown field with tag 34735 (0x87af) ignored. (hs256.tif).
hs256.tif TIFF 1942x1421 PseudoClass 256c 8-bit 2698kb 0.0u 0:01

#> identify hs64.tif
hs64.tif TIFF 1942x1421 PseudoClass 256c 8-bit 2697kb 0.0u 0:01

#> identify hs64_irfan.tif
hs64_irfan.tif TIFF 1942x1421 PseudoClass 256c 8-bit 1101kb 0.1u 0:01



Lowell Filak wrote:
> I'm no expert in color pallettes but you would think that should work.
> If you run the Imagemagick identify on the files does it show a 12/64 color pallette 'reserved' or is one of them reserving more and only using 12/64?
> Lowell
>  
> The following message was sent by Dylan Keon <keon at nacse.org> on Wed, 05 Mar 2003 14:37:55 -0800.
> 
> 
>>I'm trying to display a colored tiff (single DRG 1:24K quad) on top of a 
>>grayscale shaded relief tiff.  When using 8-bit PNG output, the DRG 
>>appears as grayscale if both layers are displayed at the same time.  If 
>>I turn off the shaded relief layer, the DRG is colored correctly.
>>
>>I've reduced the color depth of the grayscale shaded relief image to 64 
>>colors using Imagemagick, but still have the same problem.  Shouldn't 
>>that make enough colors available between the shaded relief (64 colors) 
>>and the DRG (12 colors)?
>>
>>I've experimented with both 3.6.4 and today's 3.7 CVS version.  I'm 
>>doing this through a PHP MapScript application, but I get the same 
>>result with each version's shp2img.  It does work ok if I use 24-bit 
>>output in 3.7, but I'd like to stick with 8-bit if I can.
>>
>>Thanks for any tips.
>>
>>--Dylan





More information about the MapServer-users mailing list