[Mapserver-users] Size reduction and Re: EXTENSION parameter in OUTPUTFORMAT removed?

Vinko Vrsalovic vinko at cprsig.cl
Tue Feb 25 13:49:06 PST 2003


On Tue, Feb 25, 2003 at 04:20:22PM -0500, Frank Warmerdam wrote:
> >2.- I rendered a map with vectors and a raster 8 bits B/W layer. If I
> >used the default PNG outputformat, the vectors got rendered in B/W also,
> >if i turned the raster layer off, the colors were normal, if I turned on 
> >the raster layer, all was rendered in B/W.
> 
> The problem is that the greyscale raster layer is grabbing 256 greyscale
> colors for rendering itself.  There are various possible solutions to this:
> 
>  o Use 24bit output.

That's what I'm doing right now. The problem is the size of the
images... a 400x400 PNG 24 bits image is around 250Kb and the 8 bits
version is half the size...

BTW, are there 'standard' ways to reduce output size from the input?
I'd like to keep the size as low as possible but with best quality :-).
Yes, I know there's a trade off, but I don't know a thing (well, maybe
one or two) about raster formats so I don't know what might be best... 

Do the best things to do vary between color and grayscale images?

My little experience say that pseudo-colored in color with reduced 
colors look uglier than their grayscale counterparts.

>  o Convert your greyscale data to a pseudo-colored format and compress
>    down to a reduced number of colors as part of this process .. I find
>    32 levels of grey is plenty for must greyscale display.

I'll try this one, too.

>  o I could implementing a processing directive forcing the greyscale
>    colormap allocator to use a reduced number of colors.
> 
> Let me know if you would like me to do the last item.  There are various
> ways it could be implemented.  One is to give the raster color allocator
> a "threshold" within which it would consider an existing color a match.
> For instance, if you gave a color threshold of 6 then only about 256/3
> greyscale values would be allocated.  This would also apply to pseudocolored
> images that have alot of colors that are very close to one another.

This idea sounds pretty good, but I'm certainly not the best person to 
decide if it should be done, would anybody else like it?

-- 
Vinko Vrsalovic <el[|- at -|]vinko.cl>
http://www.cprsig.cl



More information about the MapServer-users mailing list