how to get base64 from canvas in javascript code example Example: javascript todataurl var image = new Image(); image.src = canvas.toDataURL();