-
-
Notifications
You must be signed in to change notification settings - Fork 842
New issue
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
Converting Png to Jpg give a color background and not white (Asp.Net Core) #355
Comments
Hi @FelixLeChat , The transparent sections of the image are not actually fully transparent, rather only the alpha component of the pixels is set to zero. You'll need to manually set the background color (Using the new beta API). image.Mutate(x => x.BackgroundColor(Rgba32.White)); Cheers James |
I feel we should be doing this by default when encoding into formats that don't support alpha channels. I think we should add a |
I disagree. The encoding overheads in my opinion are too high and it's technically incorrect. |
Description
My goal is to generate renditions (thumbnail, and other size of the image) from an uploaded image (IFormFile, png or jpg).
When uploading a .png with transparency, the resulting image has a background of a color in the image and not a default white one.
Steps to Reproduce
From :
To :
if i save the outputstream as a jpg. the error occur. The image variable has also this background in color and not white.
System Configuration
The text was updated successfully, but these errors were encountered: