Bad colors with mapserver

Trond Michelsen trondmm-mapserver at CRUSADERS.NO
Thu Nov 24 08:55:19 PST 2005


Hi.

I'm serving a set of png-files with mapserver, and when I request
images as gif or png, the colors become very strange. Colors are fine
if I request a jpeg-image, though.

The image shows precipitation on January 4th 1961.

as png:
http://norgena.met.no/wmsmapserv?SERVICE=WMS&FORMAT=image%2Fpng&SRS=EPSG%3A32633&VERSION=1.1.1&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&REQUEST=GetMap&BBOX=-74000%2C6450000%2C1120000%2C8000000&TIME=1961-01-04&LAYERS=rr&WIDTH=600&HEIGHT=775

as gif:
http://norgena.met.no/wmsmapserv?SERVICE=WMS&FORMAT=image%2Fgif&SRS=EPSG%3A32633&VERSION=1.1.1&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&REQUEST=GetMap&BBOX=-74000%2C6450000%2C1120000%2C8000000&TIME=1961-01-04&LAYERS=rr&WIDTH=600&HEIGHT=775

as jpeg:
http://norgena.met.no/wmsmapserv?SERVICE=WMS&FORMAT=image%2Fjpeg&SRS=EPSG%3A32633&VERSION=1.1.1&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&REQUEST=GetMap&BBOX=-74000%2C6450000%2C1120000%2C8000000&TIME=1961-01-04&LAYERS=rr&WIDTH=600&HEIGHT=775

Original image:
http://norgena.met.no/klima/rr/1961/01/rr_1961_01_04.png


Does anyone know what I can do to get colors that are as close to the
original image as possible?


This is what my mapfile looks like:

--8<--
MAP

  name           klimawms
  imagetype      png
  extent -75000 6450000 1120000 8000000
  size           1195 1550
  units          meters
  imagecolor 255 255 255
  transparent on

  DEBUG off

  WEB
    METADATA
      "wms_title"           "Metno Klima WMS"
      "wms_onlineresource"  "http://norgena.met.no/wmsmapserv?"
      "wms_srs"             "EPSG:32633 EPSG:32634"
    END
  END # Web Interface Options
  PROJECTION
    "init=epsg:32633"
  END

LAYER
  NAME "rr"
  DATA "../klima/rr/%year%/%month%/rr_%year%_%month%_%day%.png"
  TYPE RASTER
  STATUS ON
  OFFSITE 255 255 255
  METADATA
    "wms_title" "Nedbør siste døgn"
  END
END

LAYER
  NAME "tam"
  DATA "../klima/tam/%year%/%month%/tam_%year%_%month%_%day%.png"
  TYPE RASTER
  STATUS ON
  OFFSITE 255 255 255
  METADATA
    "wms_title" "Temperatur siste døgn"
  END
END

END # map
--8<--

-- 
Trond Michelsen



More information about the MapServer-users mailing list