[TIP] Optimizing PNG Graphics
netdzynr
Member Posts: 296
For those of you building graphics heavy games (which is probably many of you), you might want to consider optimizing your PNG graphics. PNG is a great graphics format, but PNGs can contain a bunch of extra "junk" (profiles, gamma info, etc) that can be stripped out without any noticeable loss of quality (Photoshop PNGs are notorious for this). There are several tools out there for optimizing PNGs, but I just came across ImageOptim, an open source Mac app that apparently uses multiple routines to apply the best optimizing to graphics it can. As a test, I ran it on the 340 images of my current iPad game -- it took a bit over 10 minutes to run, but it was able to shave off 1MB from 5MB worth of PNGs. Pretty nice savings.
<http://imageoptim.pornel.net/>
When you open up your gameproj file (Finder -> right click [or control click] -> Show Package Contents) you can access the images folder where all your game's PNGs reside. Copy out the folder, process it through ImageOptim, and after a few minutes you should see some filesize savings (note: not all PNGs will be compressed, some may already be as small as they can get). Replace the images folder and you should be good to go.
Remember, always run these kinds of tools on COPIES of your images, and always make backups of your game files, just to be safe.
<http://imageoptim.pornel.net/>
When you open up your gameproj file (Finder -> right click [or control click] -> Show Package Contents) you can access the images folder where all your game's PNGs reside. Copy out the folder, process it through ImageOptim, and after a few minutes you should see some filesize savings (note: not all PNGs will be compressed, some may already be as small as they can get). Replace the images folder and you should be good to go.
Remember, always run these kinds of tools on COPIES of your images, and always make backups of your game files, just to be safe.
Comments
Just being able to drag and drop the files is a big time saver!
Much appreciated!
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Since GameSalad games are built with XCode, Read this
http://developer.apple.com/iphone/library/qa/qa2010/qa1681.html
I've been using XCode for a very long time, I think I know what I am talking about. In addition, I never said the gameproj is compiled with XCode, please learn to read before you make comments. This is the second time you are claiming I said things that I did not.
How do you think gameproj files are executed? Magic? No, its executed by an app that is built in XCode, and that app (along with your files) are then packaged.
When looking closer at a packaged gameproj file here that contains 500+ PNGs, it seems that some of the assets *do* appear to be optimized as mentioned in the article you cite above. And yet many are still not.
It's weird -- I can't see any rhyme or reason in the division. At first I thought maybe there was some size threshold affecting which images were processed, but both small and large images show up here as "unoptimized" (openable in Preview/PS and the like). Not sure why -- maybe it's just the nature of beta software...
I wonder if other folks are getting similar results in their builds?
That's cool, go look up PVR compression and see what compression is about, that is the real savings we don't have access to with Game Salad. It is not good for all images though, but static backgrounds can certainly benefit.
Oh, and PVR images take less ram in addition to a smaller bundle size. A few megs is not great, 50% or more is great
To be honest we can only find out from Gendai because it matters on how they setup the project file (not talking about the game salad project).
The fact that it did not do them all is strange!
image crushers strip all that stuff out.
They might optimize them further by limiting the color palettes, but I am not sure.