Optimise your PNGs to reduce your app size
Monkey Archive Forums/Monkey Discussion/Optimise your PNGs to reduce your app size
| ||
Here's a utility I put together some time ago. MacOS X only sorry, but there are similar tools for other platforms. It will optimise one or more PNG files to reduce their size whilst keeping all the quality. It can do this as internally PNG offers a number of compression methods and related options. The tool just brute force checks all of them, recompressing the PNG over and over, and picks the one with the smallest filesize. I was able to reduce an image heavy (1000+) iOS app from 4MB to just 800KB. http://www.gingerbeardman.com/pngenie/ Note: PNGs over a few hundred KB in size may take a while to optimise, so be patient. |
| ||
Very interesting idea -- does anyone know if there's something similar available that runs under Windows? |
| ||
Internally my tool uses several open source components, all of which are available for Windows. There may be GUIs or wrappers for them, have a look around. Anyway, they are: optipng http://optipng.sourceforge.net advpng http://advancemame.sourceforge.net/comp-readme.html pngout http://www.advsys.net/ken/utils.htm Each gives variable results, so I run each PNG through all of them. There are others - such as pngcrush - but they do not improve on the results from these three. |
| ||
Thanks! Nice to a be Mac user. |
| ||
Nice to me. Thank you very much. |
| ||
Very cool, and useful! I got instantly the idea to make a wrapper which calls all the 3 Windows tools, but it can be probably done with a simple cmd file :) |
| ||
Cool! But I guess you must be aware of such effects: http://monkeycoder.co.nz/Community/posts.php?topic=257 |
| ||
Yes, good point! The loader used by GLFW can only handle 8 bit formats - PAL8, RGB24 and RGB32 - whereas png has some extra 4 bit formats. Some PNGs will not work in GLFW target with monkey. In this case resave them manually using a paint program that is known to save PNGs that work with Monkey. |
| ||
For windows users Ive always used http://psydk.org/PngOptimizer.php - still use it for BMAX projects as Photoshop sometimes leaves nasty edges and it does a good job at reducing the file size. |
| ||
Thanks but sadly no improvements on the pictures i've used it on. |
| ||
Can you send me these pictures? Thanks |
| ||
No because i only made two random testrenderings without saving any project files and deleted the pictures afterwards. I just made a further test with a screenshot of my desktop reduced to 960x600 and this time the filesize went slightly down from 676kb to 647kb, i guess this one isn't of interest to you? |
| ||
No, but thanks. If you ever come across an image that can't be compressed then I'd like to know which program you created it with. Thanks! |
| ||
I rendered the pictures with Modo. I remember that Macromedia's Fireworks built the smallest filesizes of all programs i knew, always a few kb less than the competition. |
| ||
I recently updated this utility, some may find it useful. :) |
| ||
http://smush.it <- good for optimizing websites, might be useful for game graphics as well |
| ||
The FAQs state that service uses the same command line tools as my app. http://developer.yahoo.com/yslow/smushit/faq.html |