[Tilecache] Where in TC code is metatile cutting?
Ivan Mincik
ivan.mincik at gista.sk
Wed Jan 20 02:52:02 EST 2010
> Ivan,
>
> Using PythonMagick, I was able to create the following image:
>
> http://img35.imageshack.us/img35/6583/testyi.png
>
> using this code:
>
> import PythonMagick
> import urllib
>
> data = urllib.urlopen("http://gista.sk/dl/test.png")
> blob = PythonMagick.Blob(data.read())
> image = PythonMagick.Image(blob);
> image.quantizeColors(256)
> image.quantizeDither(False)
> image.quantize()
> image.write("/tmp/test.png")
>
> PythonMagick can be somewhat difficult to unstall, although it was
> trivial on Ubuntu server as a package already exists for it.
Thanks a lot for this example.
I seems that original quantized image from UMN Mapserver is loaded by ImageMagick to some internal structure and than it
can be processed (cut metaTiles to tiles, ...). If I want to save it to same format as it was produced by UMN Mapserver
I need to use quantize again in ImageMagick. Resulting palette is totally different to original so UMN Mapserver
quantization is lost/replaced by ImageMagick and therefore is not needed - I rather can produce RGBA images from UMN
Mapserver to save CPU.
Still, we don't have a solution for cutting quantized metaTiles in python and saving them back without any changes to
palette.
> You appear to have better results with MapServer and indexed RGB
> output. I was never able to get the fonts looking good, hence the
> post-processing to reduce the color depth with ImageMagick. Can you
> share your OUTPUTFORMAT section of your map file?
My outputformat section. Using UMN Mapserver 5.2.x
OUTPUTFORMAT
NAME "PNG_AGGAQ"
DRIVER "AGG/PNG"
MIMETYPE "image/png"
IMAGEMODE RGBA
FORMATOPTION "QUANTIZE_FORCE=ON"
FORMATOPTION "QUANTIZE_DITHER=OFF"
FORMATOPTION "QUANTIZE_COLORS=256"
FORMATOPTION "INTERLACE=OFF"
EXTENSION "png"
END
Ivan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.osgeo.org/pipermail/tilecache/attachments/20100120/15114156/attachment.bin
More information about the Tilecache
mailing list