Problem with mojo2 / images and "alpha maps"

Monkey Forums/Monkey Beginners/Problem with mojo2 / images and "alpha maps"

lukas_(Posted 2017) [#1]
Hey! First post, hobby programmer who's not actually very good at it, blah blah ...

So I've tried to play around with mojo2 a bit and came upon something I don't understand. Basically, here's what I'm trying to do:

I have an image called alphaMap onto which I render stuff with different alpha values in opaque blend mode.
I have another image called inkMap onto which I first render some stuff and then the alphaMap in opaque blend mode. To make sure that only the alpha values are passed on, I use SetColorMask(False, False, False, True).
I want to render this inkMap onto some background image, which kind of works, but for some reason, even where the alpha values of the inkMap should be 0, it looks like there's some sort of additive stuff going on. So if the base picture for my ink is just a red plane, white background stays white, but gray turns into light red and black into red.
This isn't happening if I directly render alphaMap onto the background. Not using SetColorMask also works, but kind of defies what I'm trying to do.

I suppose there's an easier or more elegant way to get this result with mojo2, and I'd be grateful if someone pointed me into the right direction. Still, I don't understand why this addition is going on. Is there something about Images / Canvases I don't understand, or am I missing something else?

Here's a full example code. Not very clean, but hopefully gets my point across:


I'd be thankful for any insights :)