Enhance image

Frank Warmerdam warmerdam at POBOX.COM
Tue Apr 11 09:23:13 EDT 2006


salah jubeh wrote:
> Hi guys,
> I have a problem such that i have 1 band images and these images is 
> unsigned 16, when MapServer create PNG images for viewing , these images 
> are very dark. How can i  enhance there appearance or how can i 
> apply RGB templates on them.

Salah,

You can control how 16bit imagery is scaled to 8bit with the SCALE
PROCESSING options.  The raster data access howto should touch on these.
But for instance if your data has values from 0 to 4000 but the vast
majority of the pixels are in the range 0 to 500 then you might use something
like:

  PROCESSING "SCALE=0,550"

This would stretch input value 0 to black, 550 to white and any values over
550 to white.

However, if you have no scaling options it is likely that that a dark image
indicates a dynamic range mostly well below 255 to start with. In this case
just adding
   PROCESSING "SCALE=AUTO"
may help a lot.

If you want to use a color ramp (rather than just greyscale output) then you
might look into the color range options.  For instance:

LAYER
   NAME grid1
   TYPE raster
   STATUS default
   DATA data/float.tif
   PROCESSING "SCALE=-10,28"
   CLASS
     STYLE
       COLORRANGE 0 0 0   255 0 0
       DATARANGE -10 28
     END
   END
END

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    | President OSGF, http://osgeo.org



More information about the mapserver-users mailing list