Open f2d opened 4 years ago
This is because even though leanify will keep all the apng chunks, zopflipng and lodepng doesn't have native apng support
https://github.com/google/zopfli/issues/118
https://github.com/lvandeve/lodepng/issues/98
And in some cases an optimization will change the color type based on only the first frame, and that might break the rest of the frames.
It looks like setting keep_colortype
will stop that from happening, but at the expense of missing many potential optimizations, but I think it's better than breaking the image, we can detect if it is apng based on existence of the apng chunks and set keep_colortype
accordingly.
Hi, thanks for this tool. I just noticed this issue today in that Leanify is corrupting my PNGs that use alpha channels, or at least some of them. I just checked the latest Nightly build and it seems to have the same issue. Are you planning to implement the above fix?
Not pushing you, just wondering - thanks!
@Liam2349 If your PNG isn't an APNG (Animated PNG), then it's a different issue.
By default Leanify will modify fully transparent pixels to make it more compressible, because those values don't affect how the image is displayed at all, but if you don't want this behavior, you can pass --png-lossless-transparent
to the nightly build.
Hi.
As APNG is explicitly supported here, I tried
leanify -v
on some of my files. It appears to work and does not report anything suspicious:But result either shows areas of garbled pixels after the first frame, or is completely not animated, depending on specific file. XnView says that unplayable file is "multipage" instead of simply playing animation, and selecting its pages does not show any change.
Identical results with Leanify build 244, 243, and the last v0.4.3 release from the GitHub page. Edit: Also identical results with build from latest source on a Linux server.
All files from gif2apng v1.9 (this was the best result I got back then, when I tried various ways to create APNG) become garbled. Other files are probably from paint.net with plugins. They become unplayable.
I'm attaching the original and result files here. apng_corruption.zip
I'm thinking to try creating APNG files with more recent software sometime later.