Crushing Every PNG in a Folder Hierarchy with a Batch File

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
Continue reading

Easily Create a Windows App Icon with Gimp

Icons and how they appear in your target OS are the sort of thing you don’t think much about until you actually have to make them. This was definitely the case for me after I prepped a build of Ookibloks and noticed that the icon was blurry.

Looking more closely at how icons behave on my Windows machine, I noticed how icons that may look fine at medium size, will look like a lame little image in the middle of an empty square at larger sizes.

Various icons in Windows at medium view

Various icons in Windows at medium view

Various icons in Windows at large view

Various icons in Windows at large view

The effect is even more pronounced when using the extra-large icon view.

Icons at extra-large view

Icons at extra-large view. Whoah!

Naturally, I wanted to make sure that Ookibloks has an icon that looks good wherever it resides on a player’s machine. This post is a result of said semi-deep dive into app icons on Windows.

Continue reading

Recursively Erasing Thumbs.db from your Game Resources

Despite our best efforts, Thumbs.db (a hidden file that Windows uses to store Explorer thumbnails for all the images in a folder) often manages to sneak its way into game data folders. At least, that has been the case for me while putting together build scripts for Ookibloks.

Before potentially releasing a build with one or more Thumbs.db hiding in the game’s data, I’ve found it useful┬áto scrub out all the Thumbs.db files from my game data with a console command like this one:
del /s /A:H resource\Thumbs.dbContinue reading