[Tilecache] Tilecache_seed and jpeg quality

Guillaume Sueur no-reply at neogeo-online.net
Sun Aug 23 16:54:41 EDT 2009


Hi devs,

Using tilecache_seed with metaTile and jpeg output I noticed a poorer 
image quality than without metaTile. I found out it was coming from the 
use of PIL which uses a default jpeg quality setting of 75 %. I've made 
a patch for this, using quality of 95 when format is jpeg. 95 is the 
best quality, 100 is not using quantization at all and produces fat images.
I've also added the optimize=True option, though I'm not sure it's a 
good idea as the metaTile output should be exactly the same than the 
standard one, and all quality settings should be let to WMS server. But 
it was interesting for my own approach so I let it in.

Here is the diff on Layer.py :
406a407,408
 >                 elif self.extension == 'jpeg':
 >                     subimage.save(buffer, self.extension, quality=95, 
optimize=True)

Feel free to patch, or not, tilecache with it !

Best regards,

Guillaume Sueur



More information about the Tilecache mailing list