Closed emizzz closed 2 years ago
Thanks a lot for this PR!
I'd like to have this as an addition to the API, instead of using getSaveData. E.g. you could add a getImageData()
function, which uses the canvasToRasterImage function with the correct canvas ref.
Also, I'd like to add the ability to also save with the background image, if one is given. Right now, you'd only support using a custom background color, right?
Please let me know your thoughts and whether you can tackle these.
@emizzz @embiem if you want I could move this to a separate API? I am currently working on a project using this library and was just about to start working on export to PNG/JPEG when I spotted this PR.
Hey @ern-arrowsmith, thanks for the interest! Feel free to create a PR. If possible, I think it'd be good to have 3 options:
I'd also argue that exporting with the background image should be the default, if one was provided.
Closing this & will merge #78 as an extension to the already merged #97
Added the "png" and "jpeg" save mode.
If 'getSaveData' is called without params, it behaves in the default way. If the argument is 'jpeg' or 'png', the method returns the data in the specified format.