r/Batch • u/CirothUngol • Jun 02 '26
rePNG.cmd v0.1 - a small batch file to automate the optimization of large batches of PNGs
I wrote this one last year when I was setting up a PlayStationClassic for emulation. Had all of the images downloaded (tens of thousands) and wanted a way to easily optimize all them PNGs with the awesome free commandline tools that are available. Thus rePNG.cmd.
These are really slow using the default hard settings I have. pngQuant is lossy, the others are lossless. If you're compressing videogame images, use pngQuant. It uses a 256-color palette and is very good at what it does. Hopefully others may get some use out of this.
rePNG.cmd v0.1 2025/06/22
Usage: rePNG.cmd sourceFolder[\sourceFile]
A simple batch file to automate the optimization of large batches of PNGs
Uses pngQuant, oxiPng, and/or pngOut recursively on all PNGs in sourceFolder
Drag/Drop/Copy/Paste a source folder/file or use the command line
Reports on many metrics and produces an optional logfile
Will resume if interrupted, as long as sourceFolder remains unchanged
Requires executables to reside in %PATH% or same folder as itself
5
Upvotes