Skip to content
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

APNG conversion issue #4657

Closed
karolyi opened this issue May 30, 2020 · 8 comments · Fixed by #5126
Closed

APNG conversion issue #4657

karolyi opened this issue May 30, 2020 · 8 comments · Fixed by #5126

Comments

@karolyi
Copy link

karolyi commented May 30, 2020

Hey,

I tried to convert an APNG with Pillow and got a bad looking output. It seems that WEBP saving works a bit better but there are also problems. This issue is about converting an APNG into an APNG while having the same watermarking/thumbnailing as in #4644. I've attached a self-contained test code apng-test.zip to reproduce the problem.

The used APNG is downloaded from https://en.wikipedia.org/wiki/APNG, the wikipedia article about APNG formats.

Hope to get this fixed soon, because I have to convert all APNG-s into WEBPs to be able to look half decent.

@radarhere
Copy link
Member

While I recognise the output is still not good, on a practical level, I found that if you remove disposals from your save arguments, the disappearing effect is fixed.

out

@karolyi
Copy link
Author

karolyi commented May 30, 2020

Interesting. Can you post the adjusted code please? I thought the disposal argument in the save_kwargs is that one.

@karolyi
Copy link
Author

karolyi commented May 30, 2020

Oh, I misread, my bad. It's actually removing that argument that helps? Odd, one would think you'd have to add that back to the save parameters.

@karolyi
Copy link
Author

karolyi commented May 30, 2020

Even if you remove the watermarking, you'll get a bad looking result after conversion:
out

@radarhere
Copy link
Member

radarhere commented Dec 24, 2020

I find that if you remove disposals from the save arguments, and run your code with #5126, the result looks correct.

out

@radarhere
Copy link
Member

I think the reason that you don't need disposals when saving is that Pillow isn't giving you each frame as it was originally encoded, as a series of cropped regions to be combined later - it's applying disposals and blends to give you the combined result that a user would see.

So by the same logic you shouldn't need blend when saving either.

@radarhere
Copy link
Member

This should now be fixed in Pillow 8.1.0, due to be released in the next day or so.

@karolyi
Copy link
Author

karolyi commented Sep 28, 2023

Hey,

it's a bit belated but can confirm it works with Pillow 10.x :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants