We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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)
The text was updated successfully, but these errors were encountered:
For PNG images, use cropper.getCroppedCanvas().toDataURL('image/png') instead of cropper.getCroppedCanvas().toDataURL('image/jpeg').
cropper.getCroppedCanvas().toDataURL('image/png')
cropper.getCroppedCanvas().toDataURL('image/jpeg')
Sorry, something went wrong.
try different solutions like canvas.toBlob(blob => { const file = new File([blob], "tmp", { type: "image/png" }); onFileReady(file); }, 'image/png' , 1);
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);
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
No branches or pull requests
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)
The text was updated successfully, but these errors were encountered: