I have a canvas with an id #cnv.
<canvas id="cnv"></canvas>
<img id="img" src=""></img>
I converted the canvas to an image using the code below:
var a = document.getElementById("img");
a.src = document.getElementById("cnv").toDataURL();
After doing so, I save the image in physical disk.Below is the result image:
It's background is white and not transparent. I want to make the image transparent except the lines that is drawn into it.How will I do that?