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