[Tilecache] Where in TC code is metatile cutting?

Mark Deneen mdeneen+tiles at saucontech.com
Mon Jan 18 15:45:49 EST 2010


Ivan Mincik wrote:
> On Sun, Jan 17, 2010 at 10:49 AM, Guillaume Sueur
> <no-reply at neogeo-online.net> wrote:
>   
>> Hi,
>>
>> What about using image-magick
>> (http://www.assembla.com/wiki/show/pythonmagickwand) to crop the
>> MetaTile image ?
>>
>> It's maybe worth a try.
>>     
>
> So, I did test with following code:
>
> #!/usr/bin/python
>
> from pythonmagickwand.image import Image
> i = Image('test.png', '8-bit')
> i.format = 'PNG'
> i.save('out.png')
>
> Test image is here: http://gista.sk/dl/test.png
>
> Input 'test.png' is 8bit palleted image, but resulting 'out.png' is
> RGBA . Any idea what to change to get same image type in output?
>
> Ivan
>   
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.

I plan on using PythonMagick to quantize to 64 colors and to clamp the
values to a particular color map such that adjacent tiles do not have
different colors.

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?


Mark




More information about the Tilecache mailing list