Javascript: Save image from <canvas /> as png file and preserve canvas opacity

25 Views Asked by At

I use the following code to save canvas content as png image file to server storage:

canvasEl.toBlob(blob => {
    const file = new File([blob], fileName);
    onImageUpload(file, fileName);
});

and it works fine. canvas also has opacity settings set using CSS { opacity: value }. What I need is to save PNG file with same opacity as canvas has through CSS property opacity. How can I do it on web browser side?

0

There are 0 best solutions below