javiergutierrezchamorro / nikkhokkho

Software Javier Gutiérrez Chamorro (Guti)
http://nikkhokkho.sourceforge.net/
7 stars 4 forks source link

RFE/C: After Running PNG Toolchain, Process IDAT via Zip ToolChain #6

Open TPS opened 8 years ago

TPS commented 8 years ago

@javiergutierrezchamorro I was browsing @glennrp's repos recently, & I ran across the pngzop readme. IIUC, in a nutshell, pngzop is (was?) his effort to integrate zopfli compression directly into his pngcrush, bypassing zopflipng's own filter heuristics. In that method, pngzop would eventually dissect the PNG, pull the IDAT out, & process via zopfli (not zopflipng), & then reassemble. Better tool in https://github.com/javiergutierrezchamorro/nikkhokkho/issues/6#issuecomment-373596777

Since FileOptimizer has a far better zip toolchain than just zopfli, maybe it'd be worth integrating the pngzop dissection-&-reassembly tools (&/or any others, at your preference) via a similar process into the PNG toolchain.

Thoughts/comments/interest?

javiergutierrezchamorro commented 8 years ago

I will try to do a Win32 and Win64 builds of 1.8.1, and try them.

TPS commented 8 years ago

I will try to do a Win32 and Win64 builds

@javiergutierrezchamorro I was searching for Windows builds of the various pngzop-specific tools (in the source tree as pngzop_*.c), & none seem to exist. Did you have any luck? If so & you'd like to post them someplace, I'd like to try them out manually to work out if it's worth converting the pngzop sh script to a cmd/batch, or maybe write my own.

javiergutierrezchamorro commented 8 years ago

Not yet. I have been quite busy with my real job lately, while FileOptimizer efforts have gone on the side of optional lossy recompression (JPEG and GIF), as well as adding more formats, and improving optimization ratio.

TPS commented 6 years ago

@javiergutierrezchamorro: @MrKrzYch00 of Zopfli KrzYmod fame has made available krzydefc (README & binary @ GitHub or encode.ru) to convert ↔ {GZ, ZIP, ZLIB, PNG}, which is specifically designed to effect this kind of toolchain. Would you interested in taking a look?

(Pointed out in https://github.com/sayurin/optipng-zopfli/issues/2#issuecomment-368951693 onwards.)

javiergutierrezchamorro commented 6 years ago

Thanks @TPS According to what I saw it seems to be always compressing files inside a ZIP or GZ container. So what would be the idea? Uncompress original ZIP/GZ, and then compress with Zopfli KrzYmod?

TPS commented 6 years ago

Nono, after running PNG through typical FO toolchain, convert to ZIP/GZ (whichever has better tools), run through FO as such, & then convert back. Or whatever permutation of that is optimal. krxyfefc isn't specific to only @MrKrzYch00's tools, I believe.

TPS commented 5 years ago

Similarly, after running APNG through its dedicated toolchain (mostly APNG Optimizer?), use APNG DisAssembler, run through PNG → ZIP toolchains (as detailed above), & then use APNG Assembler. Or vice versa, &c, in optimized order.

javiergutierrezchamorro commented 5 years ago

Similarly, after running APNG through its dedicated toolchain (mostly APNG Optimizer?), use APNG DisAssembler, run through PNG → ZIP toolchains (as detailed above), & then use APNG Assembler. Or vice versa, &c, in optimized order.

Not as easy because once APNG is disassembled, you are loosing the information of duration of each frame, and thus you will not be able to reconstruct again with the assembler.

TPS commented 5 years ago

Of course, 1 isn't (yet) deleting the original, right? So, that'd be used as the template to reassemble correctly.

javiergutierrezchamorro commented 5 years ago

Of course, 1 isn't (yet) deleting the original, right? So, that'd be used as the template to _re_assemble correctly.

Sure. But this will require implementing additional code on FO just to read and keep track of all frame information.

TPS commented 5 years ago

TweakPNG Command Line might be able to help w/ that, though (clearly) no longer maintained. I'll ask whether its command-line bits can be supported in mainline TweakPNG.