According to my tests, you can maybe optimize PNGOUT for some Paletted PNGs. I think the /c3 option do not recode the Palette correctly to apply filter /f5. Changing the Palette's order can give best results.
- PNGOUT apply compression without /c3, palette is optimized for /f5 : -f5 -d8 http://www.css-ig.net/correct-organisation-palette-filtre.png
Regards.
Edited by css-ig at
Awesoken at
Re: PNGOUT feature request - c3 option
In PNG (and Deflate) compression, there is no such thing as a "best" result except in the very simplest of cases. So it's a game of approximation and guessing. How would you sort RGB colors? By their intensity? Green intensity? Hue? Saturation? Perhaps a better approximation would be to view palette entries as coordinates in a RGB color cube. Then connect the dots with the shortest path possible. This is a travelling salesman problem, so it has no fast and exact solution.
Often, the existing palette is in a pretty good order. When that's the case, you can use the /kp option to disallow palette reordering.
css-ig at
Ken,
Maybe you can add a "test option" to let the user to sort the palette by :
Colors values : 255,255,255 > 0,0,0 ; Red (255 > 0) Green, Blue ; By popularity ; Or like the exemple below.
It's not applicable to all images, i know, but sometimes it works. Another exemple :
Good afternoon css-ig! Explain, please, as you have received such results? As I understand all business in palette sorting. You used what program for palette sorting?
Edited by lorents at
joey_sw at
PNGOUT feature request
Hi Ken
I'm a fan of your excellent PNGOut & KZip, i use both of 'em for my compression needs, regulary. i would like suggest feature to compress the file with one less/more huffman blocks, than what already writen.
for example: file img01.png that already compressed containing 20 Huffman blocks. With option say /n- (or /n+) PNGOut would tried to compress it with 19 (or 21) Huffman blocks, to see if the resulting file could be smaller or not. Repeated (batch?) usages of this can be as brute force way to find out the most optimum number of Huffman blocks for the smallest possible result, just keep using it until PNGOut said that the image can't be compressed further.
i usualy call PNGOut compress as success, when KZip give up on KSFlatting it. ;)
since its appear that PNGOut set an errorlevel at end of execution, i would also ask what the errorlevel value in relation of PNGOut result? EDIT: nevermind my last question, i found the answer "Awesoken" said
I have updated PNGOUT.EXE with your request. It now returns: 0: if the file compressed further 1: if there was an error like 'file not found' 2: if the file was unable to compress further
so while is not errorlevel 2, theoreticaly i could keep repeating Huffman Blocks number adjustment ::)
Edited by joey_sw at
Awesoken at
Re: PNGOUT feature request - c3 option
It should be possible to simulate this feature by using the list option (/l) of PNGOUT; parsing the line of output, incrementing or decrementing the value by 1, and then re-running pngout with the new value.
t24 at
Talking about palette optimization, i found that Image Analyzer use some interesting heuristic in its "optimize palette" feature. Could one look closer to it to make PNGout even stronger.