Save Canvas element to an image
canvas.toDataURL()
generates a data URL of the image, by default a PNG.
// jpeg
canvas.toDataURL("image/jpeg", 1)
- encoder option parameter for jpeg ranges from
0
(lossy) to1
(lossless)
canvas.toDataURL()
generates a data URL of the image, by default a PNG.
// jpeg
canvas.toDataURL("image/jpeg", 1)
0
(lossy) to 1
(lossless)