Bad colors with mapserver

Sean Gillies sgillies at FRII.COM
Thu Nov 24 14:37:14 EST 2005


On Nov 24, 2005, at 11:36 AM, Trond Michelsen wrote:

> On Thu, Nov 24, 2005 at 09:08:54AM -0800, Tyler Mitchell wrote:
>>>  name           klimawms
>>>  imagetype      png
>> Hi Trond,
>> Trying changing imagetype to PNG24...
>
> Hmm. I've tried setting imagetype to "png24" without success. But I
> can try "PNG24" as well.  It'll have to wait until tomorrow, though.
>
> I was also thinking this could be a good opportunity to experiment
> with OUTPUTFORMAT.
>

Trond,

Sounds like you've used up all 256 colors in the standard 8-bit PNG  
palette. If JPEG looks OK, then 24-bit PNG should be OK too.

One of the most common causes is anti-aliased freetype fonts. Your  
font color may be black, so you figure one color, right? Well, if you  
look at your image closely, you'll see that black text rendered with  
anti aliasing over a blue polygon actually uses 12+ colors. In the  
same map, you'll also have text over green polygons, red polygons,  
with another 12+ colors for each. It adds up quick. Using pixmap  
symbols can also eat up big chunks of color space in your output image.

If you have to use an 8-bit indexed color PNG, you can reserve  
important colors by drawing layers with that color early. All you  
have to do is draw a single point or line.

gobble gobble,

Sean

---
Sean Gillies
sgillies at frii dot com
http://zcologia.com/news



More information about the mapserver-users mailing list