Ah, right you are!

Dunno what I was mixed up about...

On Wednesday, November 19, 2014 10:33:21 AM UTC-5, Stefan van der Walt wrote:
Hi Adam

On 2014-11-19 00:01:06, Adam Hughes <hughes...@gmail.com> wrote:
> img1 + img 2 --> adds values
> img1 U img2 --> replaces values
>
> Essentially, overlay all the pixels that are not black.
>
> Is there a library or set of functions somewhere that makes this easy?  I
> remember a while back thinking I would have to write my own overlay/masking
> utilities to get this behavior, but I hope that's not true.

It should be fairly straightforward, if I understand correctly:

mask = (img2 != 0)
img1[mask] = img2[mask]

Regards
Stéfan