[MapProxy] Force PNG24 on single cache

Just van den Broecke just at justobjects.nl
Wed May 13 06:34:52 PDT 2015

Hi Oliver,

Your config is accepted and the MP WMS advertises both image/png and 
image/png; mode=24bit in the capabilities. Both formats are accepted in 
the GetMap request, but the WMS always returns PNG8 on both. No matter 
the value of globals.image.paletted or the tile cache format.

The only way I can force PNG24 via the WMS is when 
services.image_formats contains 'image/png' and globals.image.paletted: 
false. PNG24 then is returned for all WMS image/png formats, regardless 
if the underlying cache/tiles is/return PNG24 or PNG8...Similarly when 
globals.image.paletted: true the WMS returns PNG8.

So to recap: explictly enforcing PNG8 or PNG24 on individual caches and 
tile layers works ok using custom defs from globals.image.formats 
('image/png; mode=24bit' or just 'image/png' for PNG24 have the same 
effect, colors: 0 seems decisive in the png24 def). In that case 
globals.image.paletted only has effect on the WMS GetMap PNG-format.

MapProxy 1.7.1 on Ubuntu 14.04, Python 2.7 Pillow 2.8.1.



On 13-05-15 13:31, Oliver Tonnhofer wrote:
> Hi Just,
> please try the following:
>    services:
>      wms:
>        image_formats: ['image/jpeg', png8, png24]
>    globals:
>     image:
>       formats:
>         png8:
>           format: image/png
>           colors: 256
>         png24:
>           format: image/png; mode=24bit
>           colors: 0
> It would be great if you could update the docs if that works.
> Regards,
> Oliver

More information about the MapProxy mailing list