MS RFC 21: MapServer Raster Color Correction

Steve Lime Steve.Lime at DNR.STATE.MN.US
Mon Oct 16 23:54:41 EDT 2006


I like the idea. 

One comment I have is related to an idea that has been floating around
for overall map output, especially with tiled output. When Assefa and
Paul where playing around with 24-bit to 8-bit quantitization (sp?) they
found that the GD functionality was not consistent- a big problem
between tiles for something like ka-map. An idea was to allow the
definition of a pallete that could easily be pre-computed with a tool
like ImageMagick. You'd render a representative image (big enough to
capture occurances of all features) in a 24-bit image and reduce to
8-bit and save the palette. The palette would be read as the output
image is created. In the 8-bit context (e.g. 8-bit image in memory) the
palette would simply serve as a lookup table, in the 24-bit context you
would pre-load the output image (8-bit) with the palette and us
gdImageColorClosest to convert individual pixels.

I was thinking of a MAP level parameter called PALETTE that would take a
filename. Could the same parameter be used at the LAYER level with
handling as Frank describes?

My thought was not to allow definition within the mapfile, rather as an
external file with just a straight list of RGB values in the output
file:

0,0,0
255,0,0
...

So 0 would map to 0,0,0 and so on. The support at the MAP level could be
just a naive implementation 

Just thinking out loud...

Steve


>>> Frank Warmerdam <warmerdam at POBOX.COM> 10/13/06 12:31 PM >>>
Stephen Woodbridge wrote:
> Frank Warmerdam wrote:
>> Folks,
>>
>> A new RFC for a raster related feature:
>>
>>   http://mapserver.gis.umn.edu/development/rfc/ms-rfc-21/
>>
>> Consider, comment, vote...
>>
> 
> +1 looks like a very nice feature.

Steve,

Thanks

> I don't suppose this would help with stabilizing image colors in the 
> ka-map tile generation when one uses:
> 
>   OUTPUTFORMAT
>     NAME PNG8
>     DRIVER "GD/PNG"
>     EXTENSION "png"
>     MIMETYPE "image/png"
>     IMAGEMODE RGBA
>     TRANSPARENT OFF
>     FORMATOPTION "QUANTIZE_FORCE=ON"
>     FORMATOPTION "QUANTIZE_DITHER=OFF"
>     FORMATOPTION "QUANTIZE_COLORS=256"
>   END
> 
> as the output format. There is a subtle shift in the color palette
from 
> meta tile to metatile during the QUANTIZE step.
> 
> Not asking for a change in scope of the rfc, just wondering.

No, it won't help. What you really need for that is a way of referring
to a fixed quantization colormap.  The problem is that each map request
results in an "optimized" colormap for that request.  Generally that is
good, but in a tiled situation it results in slight variations between
requests that are undesirable.

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



More information about the mapserver-dev mailing list