Closed moon-web75 closed 8 months ago
For PNG images, use cropper.getCroppedCanvas().toDataURL('image/png')
instead of cropper.getCroppedCanvas().toDataURL('image/jpeg')
.
try different solutions like
canvas.toBlob(blob => { const file = new File([blob], "tmp", { type: "image/png" }); onFileReady(file); }, 'image/png' , 1);
or
const file = new File([canvas.toDataURL("image/png")], "tmp") onFileReady(file);
but result is the same. transparent background replaced with black version is 1.6.1
When I crop an image with a transparent background, why does the background color of the resulting cropped image turn black?
I want to crop image with a transparent image, means without change image background(JPEG)