Menu

#60 Stop compression trials once goal filesize is reached

open
nobody
None
5
2019-02-08
2019-02-08
RavenWorks
No

I'm using optipng in a context where my only concern is getting a PNG file below a specific filesize (if possible).

In a case like this, I'm willing to run many trials if that's what it takes to get below my goal filesize; but if I'm already below it after just the first (or second, etc) trial, there's no reason for me to waste the time it takes to do all of the remaining trials as well.

There are a couple of ways I could picture this working, and I'm not sure which would be easiest to implement; either I could just pass my goal filesize as an option which would tell it to abandon the remaining trials if it's met, or else there could be a mode where optipng only runs a single set of trials, but the user can specify which set of trials to do (i.e. I can run the set of -o1, then on the next invocation run the set of -o2 without running the trials that were already tried in -o1, then next time just the trials exclusive to -o3, etc).

Discussion


Log in to post a comment.