canvas.toDataURL("image/jpeg", 1.0) code example Example: javascript todataurl var image = new Image(); image.src = canvas.toDataURL();