You make a image where black is opaque and white is transparent (and grey is semi-transparent) and add that to the transparency attribute in your material.