Subject kind of explains this. I'm looking for a more definitive way for pngout to 'give up.' Yes we spend lot's of time trying to get compression. But I'm sure I'm not the only one who's glanced at that difference number (where difference number is diffnum in "42% oldsize -diffnum = smallersize") and knew that it would NEVER make it to the original file size because it just wasn't fast enough.
Surely many of you know what I'm talking about. You tried /f5 on that color type 3 (/c3) image just to see if it by chance would help. Some of us would probably be playing with block split thresholds. And you've said to yourself, "ahh.. NOPE!" before it even finished. How'd you know? You did a linear extrapolation of the changes in the recent passes and/or the difference number in your mind and considered the likelihood of this trial to get a file size beneath the original to be so unlikely you just want to stop pngout running right there.
Looking at a log10 fit, power fit curve, or linear(linear is a bit extreme here) of the last few 'smallersize' or 'oldsize' numbers should quite quickly yield that you'd need 100s of pases at the extrapolation of the curve, something that won't be happening anytime soon. And make this check an option thing. Getting pngout (and, of course, pngoutwin too) to just plain throw out cases that are obviously not going to make it would be a boon to massive multiple trials. Now, let's also be frank. If PNGOUT's most recent pass is already going to cause a smaller file anyways, we don't want to stop! In that case we want to keep going of course.
So what I'm basically asking for is a flag to tend to early terminate in PNGOUT.
I can show you lots of example graphs of the behavior of the successive passes toward the goal along with curve fits if you want.
Awesoken at
Re: Determine hopeless recompression attempt
Yes, you can often tell in an early pass when it won't produce a smaller file. I will not promise an option for that. In the meantime, here are some suggestions:
1. Watch PNGOUT as it runs. Press ESC if you think it won't produce a smaller file. 2. Find the best options using a faster deflate algorithm, such as pngout /s2 or optipng -o4. Then run pngout with the slow deflate.