Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Even smaller APNG files?

Main Forum
2010-11-19
2013-05-28
  • There is a program called PNGOUT which can shrink non-animated PNG filesizes about 5-10% more than most image editors without loss of quality. What kind of compression methods GIF2APNG use? Can it compete with PNGOUT or is it impossible to use same optimizations for APNG files?

    I extracted GIF-animation to frames, used PNGOUT to compress each frame and made a APNG with couple programs, but their filesizes are a lot bigger than what GIF2APNG can produce from the same GIF-file. So I assume those optimizations don't work for APNG and GIF2APNG is currently the most effective method for APNG compression? Could lossy compression give smaller filesize while preserving APNG compatibility with net browsers?

     
  • Max Stepin
    Max Stepin
    2010-11-19

    GIF2APNG uses regular zlib level 9 compression. Your guess about PNGOUT is mostly correct, in theory it could be used to optimize APNG files, with the same 5-10% benefit. But in practice it's not easy. The main problem is the lack of native APNG support in PNGOUT, and since it's closed source no one but Ken can do anything about it, and I don't know what he thinks of APNG. 

    In theory it's possible to 1) extract APNG frames to PNG files "as is", without touching zstream, 2) optimize each file with PNGOUT, 3) put them back together again "as is", without touching zstream inside.

    I have separate tools for step 1 and step 3, and they work (I compressed my squirrel.png example down to 64578 bytes that way), but the whole process is quite tedious. The only reason I have not released those tools yet is because I'm not sure how to write an easy-to-understand readme.txt

    I thought about making APNG optimizer that would run 3 steps automatically, but PNGOUT license says "reusing PNGOUT executable is prohibited without a formal business agreement". That could be a problem, depending on what they think "reusing" means.

    So, our best hope is that PNGOUT would eventually support APNG natively.

    About lossy compression: I would recommend to optimize GIF more by using less colors or/and less frames, then invoke GIF2APNG.