OpenOffice.org ships with 6 different icon sets. In terms of graphic design, some of them are very outdated and I’d be surprised if more than a handful of people were still using them. Does OpenOffice.org really need to include so many icon sets? This is an excellent area to examine for space reductions because the vast majority of space savings will be carried over to the installer. Depending on the action taken, we could shave off anything from a couple of megabytes up to ~10% from the installer. Even the most conservative actions outlined here would help save bandwidth costs. So, which ones should we get rid of? And can we make the remaining icon sets take up even less space? The quick answer to these questions is yes, but a discussion is needed because there are many options available depending on how badly we want to save every byte
First, let’s have a look at all the icon sets that OpenOffice.org ships with. To change the icon set in OpenOffice.org, click clicking Tools -> Options -> View -> Icon Size and Style. When OOo is installed, you can find these icons in /Basis/share/config/ – each theme is stored in its own zip file.
Galaxy (Default)

High Contrast

Tango

Crystal

Industrial

Classic

Now let’s take a look at the footprint of these icon sets. Between OOo 3.2 and 3.2.1 the size has been reduced; I am using the values from the OOo 3.2.1 Dev build – m14. The sizes below are of the zip files themselves.
| Name |
Size (bytes) |
Location in Source |
| Default (Galaxy) |
5,129,503 |
/default_images |
| High Contrast |
3,489,630 |
??? |
| Tango |
4,530,074 |
/ooo_custom_images/tango |
| Crystal |
4,981,721 |
/external_images |
| Industrial |
4,496,850 |
/ooo_custom_images/industrial |
| Classic |
3,064,853 |
/ooo_custom_images/classic |
As far as my explorations have led me, there are 4 main optimizations that can be made, each of which is a discussion in itself.
1. Getting rid of unnecessary icon sets
Two candidates for instant removal would be Classic and Industrial. Tango and Crystal are used for GNOME and KDE environments respectively. Do we still need to keep these? If we get rid of Classic and Industrial, we’ve already saved a little over 7MB. If we get rid of all 4, we save over 16 MB.
The matter is a bit more complex than simply deleting the zip files: the icon sets’ names are hard coded into OpenOffice.org in the source file /vcl/source/app/settings.cxx We could just ask for the unnecessary icon sets to be removed from the list, but it would be nice if this list could be dynamic rather than static. One additional option might be to have icon themes as extensions. Maybe in the future…
2. Optimizing images with PNGOUT
The vast majority of icons in each set are PNG files. We can optimize them with PNGOUT, which gets rid of unnecessary data contained inside each PNG file. The savings across thousands of files are quite impressive, even with no compression on the entire folder (Store). More on compression in the fourth point. For now, suffice to say, even if we delete no icon sets, PNGOUT will enable us to save a couple of megabytes. At the very, very least, we can do this, and we can do it quickly.
| Compression |
Size (bytes) |
| Original (as is) |
5,129,503 bytes |
| After PNGOUT, Store |
4,334,918 bytes |
| After PNGOUT, Ultra Compression |
4,195,634 bytes |
Data is based on compression using 7-Zip 9.10 Beta.
3. Remove Duplicates Within Icon Sets
One of the most obvious instances of duplication is the high contrast icons: they are represented in their own icon set, but they are also located in the Galaxy icon set. Savings could be made if we got rid of the High Contrast icons in the Galaxy icon set (which appear to be exactly the same as those in the High Contrast icon set).
A more tricky instance of duplication involves the duplication of icons using different file names. The same image may appear multiple times in a single icon set. For example: sx03125.png sx03137.png sx03140.png sx03152.png sx03153.png sx03154.png sx03155.png sx03158.png sx03219.png are all copies of the same icon. Admittedly, that’s a bit of an extreme example, but there are plenty of other icons that are duplicated 2-3 times. Changes here would need to be reflected in code that references these icons, which is where the trickiness comes in.
There is also an inconsistency in the naming of icon files: some make little sense (like the above), while others have better naming (e.g., image.png). The gains might not be worth the amout of time needed to make this work though.
4. Improve Compression
Each icon set consists of several thousand files which are stored in a single .zip file. This is done for a very good reason: if all these files were extracted, there would be a huge overhead from the way the file system stores files, especially in these cases where we have thousands of tiny files.

The Galaxy Icon set uncompressed - 4.3 MB in size, 29.2 MB on disk!
We can increase the compression of the icon sets without adversely affecting memory usage. According to 7-Zip, the difference between decompressing ‘Store’ and ‘Ultra’ compression settings is 1MB of memory. I have tested both settings and OpenOffice.org opens them fine. This can save an extra 100-200 KB per icon set. The question is, is it worth it? We might even decide to lower the compression if it reduces the memory footprint and helps OOo load 5 milliseconds faster
.