[Tilecache] Where in TC code is metatile cutting?

Mark Deneen mdeneen+tiles at saucontech.com
Mon Jan 18 10:03:11 EST 2010


Perhaps PIL is not what we should be using to slice the meta tiles.

Today, I use PythonMagick to reduce the color depth to 64 colors and
save as an 8 bit png file.  My tilecache.cfg url is set to a wsgi script
which requests the tile from MapServer, quantizes it and returns it to
TileCache.

Obviously, I would like to perform this optimization once on the meta
tile buffer, rather than on each tile.  I'd also like a way to run
optipng on each tile, even if this involves inserting each filename into
some sort of queue and running optipng at low priority to optimize the
png files in the background.  A "TileCreated" event, with a configurable
python class would be a nice way to do this, as you could do whatever
you wanted in this event.

Mark


Guillaume Sueur wrote:
> found that post : 
> http://studio.imagemagick.org/pipermail/magick-developers/2004-April/001937.html
>
>
> Le dimanche 17 janvier 2010 à 21:24 +0100, Ivan Mincik a écrit :
>   
>> On Sun, Jan 17, 2010 at 7:36 PM, Stephen Woodbridge
>> <woodbri at swoodbridge.com> wrote:
>>     
>>> 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')
>>>>         
>>> Just a wild guess with no knowledge but does something like this work?
>>> does the save method have any options or are there in attributes that you
>>> can set to control output format on the Image object?
>>>
>>> i.save('out.png', '8-bit')
>>>
>>> -Steve
>>>       
>> No, 'save' method does not accept any other parameters than filename.
>> When creating Image object You can specify type:
>> def __init__(self, image=None, type=None):
>>
>> '8-bit' value is just my guess which probably doesn't work .
>>
>> Ivan
>> _______________________________________________
>> Tilecache mailing list
>> Tilecache at openlayers.org
>> http://openlayers.org/mailman/listinfo/tilecache
>>
>>     
>
>
> _______________________________________________
> Tilecache mailing list
> Tilecache at openlayers.org
> http://openlayers.org/mailman/listinfo/tilecache
>   




More information about the Tilecache mailing list