-
-
Notifications
You must be signed in to change notification settings - Fork 851
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
Animated webp encoder #2569
Animated webp encoder #2569
Conversation
How to start workflow? |
Crikey you’re fast!! Workflows need permission to run from the repository owner. I’ll run it now. |
682218a
to
62ab3a1
Compare
I tried to play the encoded out image in my local image viewer and it plays fine. But I'm not sure how to write a good unit test to verify it. |
I would look at our Gif unit tests. We test using individual frames plus do metadata tests to ensure consistency. |
@JimBobSquarePants To avoid creating
|
If it's not used yeah. |
I'm sorry I used Resharper to refactor to |
dcadefd
to
d448321
Compare
We need to throw some test images at this now. I would like to see some testing involving alpha blending as I think we've previously implemented it incorrectly. If it works anything like png the blend should take place per scanline where a temp buffer is used to fold the initial decode before blending it with the frame row. If you look at the latest changes to #2511 you can see how it is implemented there. |
Do you mean that I should modify the WebP decoder and encoder according to APNG? Especially to address issues that arise with Blending and Disposing. Then select some new test images? |
There's a good sample for alpha blending tests at https://bugs.chromium.org/p/chromium/issues/detail?id=364679 (landscape.webp linked at the top) |
Yes. Blending needs to work per scanline within the frame region against the current frame. We always build a frame using the previous frame data. We might then clear that data before populating the frame with the decoded pixel data. If that newly decoded data represents transparent pixels and you blend with the previous frame you then lose that transparency. What we should do is write the scanline to a temporary buffer and blend that buffer with the current frame. One of the tests png images alerted me to that issue. I've also noticed we're not capturing the disposal or blending data in the webp frame metadata, we need that for encoding. |
8d2f255
to
6d7c388
Compare
6d7c388
to
b89bc54
Compare
3940f02
to
b4e1b7f
Compare
@JimBobSquarePants I tried to modify blend operation according to 66f444d. But the decoder seems to have a problem whereas it didn't before. I'm not sure if I misunderstood what you meant before. Sorry if so. |
@Poker-sang I'll try to have a look tonight. |
OK. Alpha blending works as expected using the provided test image using the correct approach. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Poker-sang This looks great now. Supper happy! Thanks ever so much for your help here and elsewhere.
@JimBobSquarePants Wow it's merged. Thank you for your help and quick response! |
Maybe we can close #1802 as well. |
Prerequisites
Description
Animated webp encoder
closed #2521