Opened 16 years ago

Closed 13 years ago

#2458 closed defect (worksforme)

force_palette deviates from supplied palette file in bad ways (sometimes)...

Reported by: sdlime Owned by: tbonfort
Priority: normal Milestone:
Component: MapServer C Library Version: unspecified
Severity: normal Keywords:
Cc: tbonfort, assefa

Description

Setting MapServer to for 24-bit output through a palette can result in unwanted changes. I've only tested with a 128-color palette but output images can contain colors not in that palette and depending on what other colors are present you can get some very strange effects (see first attachment). I suspect this is because extra space is the palette is being filled. In my case the color seeing the change is the background color so it's very apparent. The other drag is that sometimes you only want 128 or whatever colors to minimize file size so filling the rest of the color space is counter productive. What about making the allocation of additional colors an option?

I'm using with TileCache and the MapServer trunk.

Steve

Attachments (1)

bad_background.png (96.5 KB ) - added by sdlime 16 years ago.
Notice the variation in color between tile backgrounds…

Download all attachments as: .zip

Change History (5)

by sdlime, 16 years ago

Attachment: bad_background.png added

Notice the variation in color between tile backgrounds...

comment:1 by sdlime, 16 years ago

Cc: tbonfort assefa added

comment:2 by sdlime, 16 years ago

Note, that I can work around the issue by adding the background color explicitly to the palette file, then there's no guess work.

Steve

comment:3 by tbonfort, 13 years ago

Owner: changed from sdlime to tbonfort
Status: newassigned

There is no guarantee the quantization algorithms will choose the same colors for two different images if you don't force them to with a palette file.

The quantization algorithm in use now (i.e. not the GD one) is much better at creating a palette that uses the actual colors from the image, thus preventing these artifacts on adjacent background tiles.

comment:4 by tbonfort, 13 years ago

Resolution: worksforme
Status: assignedclosed

closing this one now

Note: See TracTickets for help on using tickets.