[Mapserver-users] 1-bit tiff with min-is-white

Manfred Meier m.meier at spiekermann.de
Thu May 13 09:50:57 EDT 2004


Frank,

this is my mapserver configuration:

MapServer version 4.0.2 OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP 
SUPPORTS=FREETYPE INPUT=TIFF INPUT=EPPL7 INPUT=JPEG INPUT=SHAPEFILE

and this is my mapfile

#
# Start of map file
#
NAME t1
STATUS ON
SIZE 600 600
EXTENT 2522000 5692000 2526000 5697000
##EXTENT 2561800 5709000 2565000 5712000
UNITS METERS
TRANSPARENT ON

#-------------------------------------------------------------------
#
LAYER
   NAME stadtplan
   TYPE raster
   STATUS default
   DATA "l4704kom_2_00.tif"
   CLASSITEM "[pixel]"
   CLASS
     EXPRESSION ([pixel] = 1)
     COLOR 255 0 0
   END  # CLASS
END  # LAYER

END # Map File

With this configuration the background is black and the foreground is 
white and i would like to have the background transparent and the 
forground in yellow or lightgray or any other color. I modified the 
source code in mapraster.c (i know i should not do this) and i got the 
background in white an the foreground in black, which is better, but not 
exactly what i want.

Perhaps you or any other has an idea?

Manfred




Manfred Meier wrote:
> Hello list,
> 
> I'm using mapserver 4.0.2 with perl-mapscript and i want to display a 
> tiff for which "tiffinfo" says the following:
> 
> TIFF Directory at offset 0x8
>   Subfile Type: (0 = 0x0)
>   Image Width: 9759 Image Length: 9362
>   Resolution: 508, 508 pixels/inch
>   Bits/Sample: 1
>   Compression Scheme: CCITT Group 4 facsimile encoding
>   Photometric Interpretation: min-is-white
>   Date & Time: "2001:10:30 09:32:44"
>   Software: "SICAD-RBS V5.0"
>   Samples/Pixel: 1
>   Rows/Strip: 6
>   Planar Configuration: single image plane
>   Group 4 Options: (0 = 0x0)
> 
> The picture comes up on the screen but i cannot change the 
> "foreground"-color to e.g. light-gray with CLASS and EXPRESSION in the 
> map-file.
> 
> Is this possible or have I to convert the tiff to some 8-bit format?

Manfred,

What are you using as a class expression?  I believe GDAL will treat this
image as a pseudo-colored image with two colors.  If you classify based on
[pixel] then 0 should be white originally and 1 black.

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







More information about the mapserver-users mailing list