Canvas with mask and transparent image

So if I use a mask to hide overlapping ui elements in my canvas (which is placed in world space) it also needs an Image comp. This image component causes the canvas to have a non transparent background which I dont want, so my current hack looks like this:

       canvas.AddComponent<Image>().color = new Color(0, 0, 0, 3f / 255f);

I don’t like it and on iOS it seems to cause problems, additionally it probably has some performance drawbacks.

Does someone know how to do this the right way?

If you set showMaskGraphic to false on the Mask, the image should be invisible.