A file optimization program I wrote (Windows, 64-bit): https://papas-best.com/downloads/opt...20Optimizer.7z (7.53 MiB)
Adjust settings in the tabs, select a folder with files for optimization; press Analyze, then Optimize.
Warning:
- Experimental – use at your own risk, always back up your files!
- Anything DEFLATE-related can take *very* long. I don’t care; I just let it run in the background for weeks.
- While the creation/modification date stays roughly the same, the latter is changed minimally to mark files as optimized so they are not considered in subsequent runs.
- In case of errors, a directory with a log file and artifacts may remain at your temporary directory. I may clean it up in later versions.
- If your username or the installation directory contains special characters, JPEG optimization may not work due to problems with EXIFTool’s Perl runtime. Sorry; I’m investigating!
Short:
This is similar to Nikkho’s File Optimizer, but the goals are a little differentMy optimizer tries to squeeze out every last bit without any regard to sanity. Files may take days or weeks to finish, so it’s fully multi-threaded. Under the hood, it’s the usual calls to ECT & Co. It’s a small project and I’ve only used it personally, so it doesn’t support many file formats.
Long:
I’ve been running BAT scripts on backups for quite some time, but
- the problems with unicode paths kept adding up
- good use of multiple CPU cores became more and more a concern when I cranked up compression levels
- sanity checks on the results became incredibly complicated
So I decided to write my own C++ Win32 frontend to solve these problems. I used it successfully for some years on my personal backups and projects (mostly PNG, JPG, GIF) and adjusted the UI/toolset whenever I needed to improve on anything.
The UI is inspired by Ken Silverman’s PngoutWin which I used in the 2000s. It’s multi-threaded – runs one thread per optimization, but as many parallel optimizations as you like. (Multiple threads per optimization turned out very hard to control; maybe later.)
Optimization runs with low priority, so you can keep working normally.
There’s nothing exciting to say compression-wise; all work is done by external tools. Except maybe for ArchiPNG, which I wrote a few years ago to prepare PNGs in a way they compress better with 7-Zip (especially with PPMd). No magic there, just brute-forcing filters with special zlib settings.Optimization aborts with damaged files (I think it should be up to the user to fix damaged files, not software taking educated guesses).
In general I take errors very seriously and abort to avoid data loss. However, I’ve not managed yet to enforce an actual before-after SHA check.
PNG
- Keep/delete metadata
- Full optimization via ECT
- Optimization for later archiving via a custom tool I wrote (optimal for PPMd)
- Clear/keep transparent pixels (important for textures with premultiplied alpha)
- Runs OptiPNG, ECT -60500 --allfilters-b --pal_sort=120, DeflOpt, defluff (takes very long)
JPEG
- Delete metadata, keep only Date Taken, keep anything but the thumbnail, or keep everything.
- Derotate automatically or don’t; if derotating, force losslessness or don’t.
- Runs EXIFTool for metadata, mozjpegtran for derotation, ECT for optimization.
Office (docx, xlsx, odt & Co.)
- WARNING - nonstandard! The specification requires an uncompressed MIME type as first stream in the archive, but I blindly re-compress everything. Works fine with MS/Libre Office, though.
- Recursive optimization – optimizes the contained PNG/JPEG/etc, but does not convert BMP/TGA/TIFF to PNG even if you asked for it on top-level files. (So it doesn’t destroy complex packages with specific layouts.)
- Runs 7-Zip, ECT, DeflOpt, defluff.
ZIP/gzip
- Extract, optimize, or ignore.
- Recursive optimization – optimizes the contained PNG/JPEG/etc.
- GZ optimization is a little bit weaker than Nikkho’s (because it does not remove file names).
- Runs 7-Zip, ECT, DeflOpt, defluff.
BMP/TGA/TIFF
- Can be converted to PNG (without changing the file extension).
- Runs pngout in addition to the PNG tools because it’s better at converting. It’s not permitted to re-distribute pngout, so please download it and place it in the tools subdirectory if you want to use it.
GIF
- Optimization via flexiGIF. Can take weeks.
- You can choose to convert non-animated GIFs to PNG, applying all PNG settings.
Windows
- Delete Folder.jpg *if* it is a system file, i.e. auto-generated by Windows Media Player & Co.
- Delete Album Art files from Windows Media Player.
- Delete thumbs.db.
I’m now trying to publish my stuff instead of having it laying around on my hard drive, so it got a major rewrite last week (mostly changing the polling on sub-process output to an event-based system) and now I hope it’s useful to someone out there![]()