Sorry, I'm not sure what you mean. The default draw mode for images is "copy", which does replace the pixels in the target. Can you post a bit of code showing where the issue is?
Let's call the default draw mode Copy and this newly requested drawmode Replace.
When I draw image A to B, the pixels in B should be completely disregarded.
When a pixel in A is transparent and the pixel at the same position in B is black, I want that pixel to become transparent in B when using Replace. When using Copy, B's pixel would remain black
ohhhhhh so it copies the mask too. Got it! Should be easy to do. In the mean time you should be able to get the same result by using getMaskImage(). Untested code follows:
uggggh I got all the way to the merge request (even remembered to add the documentation!) before I realized I'm using the mask to handle clipping on the edges. This isn't quite as simple as I thought it'd be.
Yeah, I don't think there's really any advantage to doing this under the hood. We'd still have to do separate passes on the image and mask layers like in that snippet above, so might as well leave it in Lua so it's more flexible.