An OSL shader for switching channels. You input two textures and then you can shuffle the RGBA channels around to make a new output. So for example you could have the red and green channels of texture A, green as a black output, and the alpha from texture B.
Or you could switch all the channels to use the red channel, so you’d have a monochrome output.
Right-click and save as.