While writing a batch file to remove stray Thumb.db files from my Ookibloks data, I figured it would be a good time to do a little extra content optimization. If, like Ookibloks, you happen to use PNG for your game’s textures, you may have a lot to gain by way of the PNG compression strategy you use.
The amount of file size compression can vary wildly depending on the compression tool used and its settings. For Ookibloks I went with pngcrush, an open-source commandline utility that can change compression methods and strip unnecessary metadata from PNG files. After experimenting with various parameters and looking up the batch file “for” expression syntax (I can never seem to remember it off the top of my head), I ended up with the following:
FOR /F %%i IN ('DIR /S /B resource\*.png') DO pngcrush.exe -ow -reduce -rem gAMA -rem cHRM -rem iCCP -rem sRGB -rem alla -rem text %%i