Ken Silverman corrected me in reference to his PNGOut utility that I used in my recent PNG article. I had stated that PNGOut was a – “Quite popular implementation of the Libpng code library…” and I was wholly incorrect as it turns out. As Ken himself puts it:

“I have never used libpng or zlib. I wrote my own library from scratch based on public documentation of the format. It was a lot of extra work on my part, but I think it was worth it. This is why PNGOUT behaves differently than most other PNG applications (in size, speed, etc…)”

Mea culpa, mea culpa.

Or to take a line from The Gospel Of Buffy – My bad.

I had been reading so much about Libpng I guess my mind ran off with me, whoops. I’m glad he corrected me, as I wouldn’t want his hard work to be attributed to someone else, and I think the results show that it was indeed worth it.

However an interesting side effect of this was that Ken was moved to action to play with his own utility. He found something very interesting, and an equally interesting solution:

“Using my current version of PNGOUT, I was not able to compress unionjack that small! So I did some research. PNG Gauntlet includes an old version of PNGOUT. I’ve made some changes to PNGOUT since then. [...] I learned that the thing that made the biggest difference was the palette order. In the version you used, PNGOUT preserved the palette order if the input was a PNG file using a palette. My current version (now old) re-generated the palette (changing the order of palette entries) no matter what. It turns out unionjack.png was one of those files that compressed better with the original palette order – about a 100 bytes better.

The point is, your sample inspired me to make some changes :) Now, PNGOUT works like this: If you put /c3 on the command line, it will generate a new palette. If you omit /c3, it will preserve the palette order. The difference now is that you can choose what you want. As a bonus, PNGOUT now defaults to paletted files when the input is a .GIF file.”

Well… wow. I’m glad that something I wrote will have a positive effect on PNGOut and PNG users in general. I could not be more pleased right now.

Ken also sent me a new Union Jack image that he’d managed to compress using his new version down to 2.95kb (3030 bytes), that version is now the one on display in the article. Forever getting smaller, I wonder if we can get it down to below 3000 bytes, anyone want to take the challenge?

You can get the Out here at Ken’s website.