Wednesday, October 15, 2008

PNG8 compression with custom palette - advice needed!

Jason Birch filed a bug a while ago for MapGuide about using custom palettes for PNG8. I am working on a large map of Australia at the moment and there are some issues with palette inconsistencies between tiles.

I did some quick xpath and was able to produce a list of colors, as used within all the layers of a mapDefinition. From that I was able to produce a JASC PAL file.

My planned approach for now will be produce map tiles in PNG-24 and then post process the tiles using a custom palette. This has the added bonus of being faster than making PNG-8 tiles.

I have been searching around for a free command line tool which will do batch PNG8 compression based off the generated palette file. There are heaps of PNG compression tools out there, but I am yet to find one which supports using a palette.

Some thing like pngsomething -recursive folder -palette generated-palette.pal

Can anyone suggest a free tool? Preferably one which runs on both Linux and Win32...

2 comments:

Anonymous said...

imagemagick?

Anonymous said...

Another utilty you may be able to use is Irafnview