Make specific color in a texture transparent
You can use a &quot;Mix RGB&quot; node set to &quot;Subtract&quot; and invert the resulting mask to get your alpha value.

Note : &quot;Compare&quot; node is a &quot;Math&quot; node with the operation set to &quot;Compare&quot;
Note : &quot;Length&quot; node is a &quot;Vector Math&quot; node with the operation set to &quot;Length&quot;. Why it is important.
Result :

You can tweak the third input of the compare node if your magenta isnt pure, to add a threshold. This will also progressively get rid of colors that are closer to the input color. Example :

Also real-life example (Green screen) :