<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    Hi Michael,<br>
    <br>
    maybe this is not an issue with Mapproxy and more a case of
    understanding the term "transparency" ...<br>
    <br>
    If a layer is transparent within mapproxy it means, that parts of
    the cached images where there are no features visible, are
    transparent as you know this from a png image for example. So this
    layer could be used to overlay other layers.<br>
    <br>
    Here is an example of some public layers I provide:<br>
    <br>
    Basemap without Labels:<br>
<a class="moz-txt-link-freetext" href="https://map.jena.de/mapproxy/wms?REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&FORMAT=image/png&STYLES=&TRANSPARENT=true&LAYERS=Stadtplan_flae&SRS=EPSG:25832&CRS=EPSG:25832&TILED=false&DPI=96&OPACITIES=255&__t=1733229586415&WIDTH=1920&HEIGHT=945&BBOX=680695.4714761135,5644588.346248855,682679.7194761134,5645564.968311355">https://map.jena.de/mapproxy/wms?REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&FORMAT=image/png&STYLES=&TRANSPARENT=true&LAYERS=Stadtplan_flae&SRS=EPSG:25832&CRS=EPSG:25832&TILED=false&DPI=96&OPACITIES=255&__t=1733229586415&WIDTH=1920&HEIGHT=945&BBOX=680695.4714761135,5644588.346248855,682679.7194761134,5645564.968311355</a><br>
    <br>
    Labels (with transparency):<br>
<a class="moz-txt-link-freetext" href="https://map.jena.de/mapproxy/wms?REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&FORMAT=image/png&STYLES=&TRANSPARENT=true&LAYERS=Stadtplan_label&SRS=EPSG:25832&CRS=EPSG:25832&TILED=false&DPI=96&OPACITIES=255&__t=1733229586415&WIDTH=1920&HEIGHT=945&BBOX=680695.4714761135,5644588.346248855,682679.7194761134,5645564.968311355">https://map.jena.de/mapproxy/wms?REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&FORMAT=image/png&STYLES=&TRANSPARENT=true&LAYERS=Stadtplan_label&SRS=EPSG:25832&CRS=EPSG:25832&TILED=false&DPI=96&OPACITIES=255&__t=1733229586415&WIDTH=1920&HEIGHT=945&BBOX=680695.4714761135,5644588.346248855,682679.7194761134,5645564.968311355</a><br>
    <br>
    Both combined:<br>
<a class="moz-txt-link-freetext" href="https://map.jena.de/mapproxy/wms?REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&FORMAT=image/png&STYLES=&TRANSPARENT=true&LAYERS=Stadtplan_flae,Stadtplan_label&SRS=EPSG:25832&CRS=EPSG:25832&TILED=false&DPI=96&OPACITIES=255&__t=1733229586415&WIDTH=1920&HEIGHT=945&BBOX=680695.4714761135,5644588.346248855,682679.7194761134,5645564.968311355">https://map.jena.de/mapproxy/wms?REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&FORMAT=image/png&STYLES=&TRANSPARENT=true&LAYERS=Stadtplan_flae,Stadtplan_label&SRS=EPSG:25832&CRS=EPSG:25832&TILED=false&DPI=96&OPACITIES=255&__t=1733229586415&WIDTH=1920&HEIGHT=945&BBOX=680695.4714761135,5644588.346248855,682679.7194761134,5645564.968311355</a><br>
    <br>
    <br>
    You are trying to get the WMS layers from basemap.de get to work in
    mapproxy. But requesting this WMS layers, there is no transparency
    within the source layer at all:<br>
<a class="moz-txt-link-freetext" href="https://sgx.geodatenzentrum.de/wms_basemapde_schummerung?REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&FORMAT=image/png&STYLES=&TRANSPARENT=true&LAYERS=de_basemapde_web_raster_hillshade&SRS=EPSG:25832&CRS=EPSG:25832&TILED=false&DPI=96&OPACITIES=255&__t=1733229586415&WIDTH=1920&HEIGHT=945&BBOX=680695.4714761135,5644588.346248855,682679.7194761134,5645564.968311355">https://sgx.geodatenzentrum.de/wms_basemapde_schummerung?REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&FORMAT=image/png&STYLES=&TRANSPARENT=true&LAYERS=de_basemapde_web_raster_hillshade&SRS=EPSG:25832&CRS=EPSG:25832&TILED=false&DPI=96&OPACITIES=255&__t=1733229586415&WIDTH=1920&HEIGHT=945&BBOX=680695.4714761135,5644588.346248855,682679.7194761134,5645564.968311355</a><br>
    <br>
    So mapproxy are not able to provide/cache transparent image parts,
    as there are none...<br>
    <br>
    <br>
    Is there a chance, that the term you are looking for in your use
    case is "opacity" instead?? ...<br>
    <br>
    From the docs:<br>
    <br>
    <b>opacity<br>
    </b>Configures the opacity of a layer or cache. This value is used
    when the source or cache is placed on other layers and it can be
    used to overlay non-transparent images. It does not alter the image
    itself, and only effects when multiple layers are merged to one
    image. The value should be between 0.0 (full transparent) and 1.0
    (opaque, i.e. the layers below will not be rendered).<br>
    <br>
<a class="moz-txt-link-freetext" href="https://mapproxy.github.io/mapproxy/latest/configuration.html#image-format-options">https://mapproxy.github.io/mapproxy/latest/configuration.html#image-format-options</a><br>
    <br>
    <br>
    Greetings Daniel<br>
    <br>
    <br>
    <div class="moz-cite-prefix">Am 03.12.24 um 13:15 schrieb Michael
      Heerdegen via MapProxy:<br>
    </div>
    <blockquote type="cite" cite="mid:878qsx0xpj.fsf@web.de">
      <pre wrap="" class="moz-quote-pre">Daniel Cebulla via MapProxy <a class="moz-txt-link-rfc2396E" href="mailto:mapproxy@lists.osgeo.org"><mapproxy@lists.osgeo.org></a> writes:

</pre>
      <blockquote type="cite">
        <pre wrap="" class="moz-quote-pre">Hi Michael,
</pre>
      </blockquote>
      <pre wrap="" class="moz-quote-pre">
Hi Daniel!

</pre>
      <blockquote type="cite">
        <pre wrap="" class="moz-quote-pre">[...] I think you have to sett "paletted" to "false" to get this work.
</pre>
      </blockquote>
      <pre wrap="" class="moz-quote-pre">
Thank you very much.

Unfortunately it doesn't make a difference.


</pre>
      <blockquote type="cite">
        <pre wrap="" class="moz-quote-pre">I am using transparent caches and I have set this option to false, so
I think this should solve the issue.
</pre>
      </blockquote>
      <pre wrap="" class="moz-quote-pre">
Are you able to share an example?  You can send it to me privately.


Anyway, it seems that transparency is a bigger issue, there are several
related "doesn't work at all<a class="moz-txt-link-rfc2396E" href="kindbugs:https://github.com/mapproxy/mapproxy/issues?q=is%3Aissue+is%3Aopen+transparencyanditalsoseemsthatthebehavioratleastsometimesandpartiallydependsontheenvironment(installedimageprocessinglibraries,pythonstuff,whatever).WhateverItriedtoaffecttheimageformat,thecachedtilesarealwaysreportedas8bitbythe">" kind bugs:

  https://github.com/mapproxy/mapproxy/issues?q=is%3Aissue+is%3Aopen+transparency

and it also seems that the behavior at least sometimes and partially
depends on the environment (installed image processing libraries, python
stuff, whatever).


Whatever I tried to affect the image format, the cached tiles are always
reported as 8 bit by the "</a>file" command.  Didn't investigate much
further here.  Dunno if the "file" output is reliable.  Gimp didn't
dissent for the tiles I tried, though.

In theory, mapproxy should be able to interpret (near) white as
transparent, independent from alpha channels, AFAIU.  But this also
doesn't work reliably (see the bug reports).

Also note that I can advice my cache with disable_storage: true - or
disable caching entirely, building the layer directly from the sources.
The visual result is always exactly the same, unexpected one.  The
problem is not cache related.

The only real transparency I have ever seen is the example in this
report:

  <a class="moz-txt-link-freetext" href="https://github.com/mapproxy/mapproxy/issues/952">https://github.com/mapproxy/mapproxy/issues/952</a>

where already the source contains multiple layers.

If anyone could contribute a working example involving transparency, I
would maybe be able to find out what makes a difference and find a
workaround for my use case.


Thank you,

Michael.
_______________________________________________
MapProxy mailing list
<a class="moz-txt-link-abbreviated" href="mailto:MapProxy@lists.osgeo.org">MapProxy@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/mapproxy">https://lists.osgeo.org/mailman/listinfo/mapproxy</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>