Would it be possible for you to expose two optional parameters for image format and image quality? By default empty method exposes png files which can be huge. It would be nice for us to provide those in options during function call instead of getting canvas and try to manipulate it.
type Optional
A DOMString indicating the image format. The default format type is image/png.
encoderOptions Optional
A Number between 0 and 1 indicating the image quality to use for image formats that use lossy compression such as image/jpeg and image/webp.
If this argument is anything else, the default value for image quality is used. The default value is 0.92. Other arguments are ignored.
Would it be possible for you to expose two optional parameters for image format and image quality? By default empty method exposes png files which can be huge. It would be nice for us to provide those in options during function call instead of getting canvas and try to manipulate it.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL
canvas.toDataURL(type, encoderOptions);