View Single Post
d-iivil's Avatar
Posts: 2,154 | Thanked: 2,186 times | Joined on Dec 2009 @ Hellsinki, Finland
#550
Originally Posted by stlpaul View Post
Hi D-Iivil,

I love your themes and this package is really awesome.

You (and every other theme author) can greatly reduce the size of your themes by optimizing the PNG files.

In dealing with PNG files on the web I've traditionally used a voodoo combination of optimizers to achieve the best results. By using this same process on all of the PNG files in your black-plastic-theme plus theme packs 1 and 2, I was able to reduce the size on disk by 37%.

The "voodoo" is that I run advpng, optipng, advpng, advdef, in that order, all on max settings (-z4 for advpng/advdef and -o7 for optipng). From my experience running them in this order and this combination seems to give the best results. (If anyone knows a better way, I'm happy to hear it).

These tools are available from:
http://advancemame.sourceforge.net/comp-readme.html
http://optipng.sourceforge.net/

They are also available to run on the device by installing the optipng and advancecomp packages in an Easy Debian chroot.

This does not change the image at all (optimized are pixel-identical to original), it simply optimizes the way the data is compressed in the file (pkzip deflate method).

For example, I installed black-plastic-theme and the packs 1 and 2, and then optimized the PNG files in /usr/share/themes/blackplastictheme-themedir

Original size of /usr/share/themes/blackplastictheme-themedir:
40,791,038 bytes

Optimized size of /usr/share/themes/blackplastictheme-themedir:
25,900,014 bytes

almost 15 megabytes of savings!

I ran this command to recursively run the 4 commands on every file (there are 100 ways to accomplish this same thing, I know...)
Code:
find /path/to/themes/ -name \*.png -exec advpng -z4 '{}' \; -exec optipng -o7 '{}' \; -exec advpng -z4 '{}' \; -exec advdef -z4 '{}' \;
Thanks for the info! This was new to me. I'm gonna try this (if I manage to install those on my Ubuntu machine) and implement optimized pngs into next update if there's no quality loss
__________________
If you're rich and you think I deserve a cold beer, you may donate one or two :-P

80's style stadium rock is back - FIRENOTE
Hi-Octane heavy metal - FORCE MAJEURE
 

The Following 2 Users Say Thank You to d-iivil For This Useful Post: