How to crop image based on Alpha in Compositor?
Use this node setup:

In the texture node, you open the image you want to use as a mask, then plug the alpha output from that to the scale node's input for X and Y (the scale node's &quot;Coordinate Space&quot; is set to relative), you grab you RenderLayer and shove it in the image input for the sacle node, and finally connect that to the composite node.