-
-
Notifications
You must be signed in to change notification settings - Fork 852
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
transparency issues with some .webp images #2528
Comments
For some reason the
If I first convert the image to be a normal lossy webp (not an animated webp), the issue goes away. Unfortunatly my usually approach to compare the decoding result to the reference implementation does not work here, since I thing the background color |
Most viewers/decoders seem to just ignore the background color.
I tried changing the color to blue: Same result, no decoder cares about it.
|
Thanks for looking at this @brianpopow I would say we are doing the correct thing by honouring the background color encoded in the image then. |
@JimBobSquarePants I would also say we do it right, but it can be irritating for user, that only ImageSharp handles animated webp in that way and other viewers/decoders dont. It's really frustrating that the spec is so vague on this. @Lovrenc how did you create the image? It seems wrong that an animated image would only contain one frame. Also if you want the image background to be transparent, you should choose a transparent color for the background, not opaque white. |
Hey, I did not create the image, I took some random images from random customers to try ImageSharp out. I will track the customer and ask about the method and intentions and come back to you. Considering what you wrote though, I expect them to just be used to some method that is at its core wrong (and encodes opaque background into an image) but produces what they want in the viewers they are accustomed to. |
@brianpopow We'd have to change |
@JimBobSquarePants Ok, I will give it a try in the next days |
Got a response: I took an existing webp file and then ran an ffmpeg command on it to make it square.
|
@Lovrenc would it be ok, if I use the image you have provided in a unit test? |
Sorry for the late reply. I do not object to it, but I do not hold a license to the artwork (though I doubt that could ever be an issue for a unit test). |
with #2547 merged it is now possible to ignore the background color with a webp decoder option. Closing this now |
@brianpopow This is probably outside of the scope of the ticket. What am I blundering? |
Hello! We're using Umbraco.CMS.Imaging.ImageSharp 13.1.1, SixLabors.ImageSharp.Web 3.1.0 & SixLabors.ImageSharp 3.1.3 Maybe I should submit this as a Umbraco ticket? |
@seanhakbb may be unrelated but I have to check the file. I want to show you something weird though.... Here's the image displayed in Edge on my laptop screen. And when it's dragged to my external screen. |
I get the exact same thing, do you think this has something more to do with the original image itself? I have never seen anything like this before |
I need to investigate the WebP and check what’s going on. |
Ok I’ve figured it out. We’re not updating the VPX8 chunk to show that there is alpha transparency in the image. This got broken when we introduced animation. I need to do some refactoring. |
Prerequisites
DEBUG
andRELEASE
modeImageSharp version
3.0.2
Other ImageSharp packages and versions
/
Environment (Operating system, version and so on)
ubuntu 20.04, win 11, ryzen
.NET Framework version
7.0
Description
Most images work fine, but some will replace part of the transparent background with white background (but not all of it, a small rectangle around the image stays transparent).
Here are the results as viewed in an image viewer.
Original:
Result:
Steps to Reproduce
Images
bugged_image.zip
The text was updated successfully, but these errors were encountered: