Hey Ernst,
Wow, this should be a fun one to debug...
My guess is it has something to do with the alpha band. Looking at source code and documentation we see the `Image.paste` method being used:
https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.paste
This is used in two locations:
https://github.com/pytroll/pycoast/blob/4687a0ea4fa4b3bf630baec907b92cd06a01c5ff/pycoast/cw_base.py#L1202
and:
https://github.com/pytroll/pycoast/blob/4687a0ea4fa4b3bf630baec907b92cd06a01c5ff/pycoast/cw_base.py#L1215
You can see from the Pillow API docs how `mask` is supposed to be used. My guess is maybe we need to be smarter about how alpha is handled with the background image and the foreground/cached overlays. Basically the alpha channel of the overlay is used to determine how to blend the pasted image with the background/original image. The docs mention an "alpha_composite" method as an alternative that maybe we want to look into.
My other guess which is still alpha related, is that when creating the initial cached overlays there is one or more pycoast drawing method that isn't setting the alpha channel completely. For example, you have coastlines configured with the color being (255, 0, 0) but don't specify an alpha. What if the drawing method is updating R, G, and B, but leaving alpha at the default 0 or maybe interpolating it to something like 128. These are all just guesses so far.
Dave
> --
> You received this message because you are subscribed to the Google Groups "pytroll" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
pytroll+u...@googlegroups.com <mailto:
pytroll+u...@googlegroups.com>.
> To view this discussion on the web, visit
https://groups.google.com/d/msgid/pytroll/8d86e94e-853a-4ea5-b6d7-d36f4e22fb0fn%40googlegroups.com <
https://groups.google.com/d/msgid/pytroll/8d86e94e-853a-4ea5-b6d7-d36f4e22fb0fn%40googlegroups.com?utm_medium=email&utm_source=footer>.