KMZ is simply a zip file with a KML file and assets. For example, the london_eye.kmz
kmz file contains:
$ unzip -l london_eye.kmz
Archive: london_eye.kmz
Length Date Time Name
-------- ---- ---- ----
451823 09-27-07 08:47 doc.kml
0 09-26-07 07:39 files/
1796 12-31-79 00:00 files/Blue_Tile.JPG
186227 12-31-79 00:00 files/Legs.dae
3960 12-31-79 00:00 files/Olive.JPG
1662074 12-31-79 00:00 files/Wheel.dae
65993 12-31-79 00:00 files/Wooden_Fence.jpg
7598 12-31-79 00:00 files/a0.gif
7596 12-31-79 00:00 files/a1.gif
7556 12-31-79 00:00 files/a10.gif
7569 12-31-79 00:00 files/a11.gif
7615 12-31-79 00:00 files/a12.gif
7587 12-31-79 00:00 files/a13.gif
7565 12-31-79 00:00 files/a14.gif
7603 12-31-79 00:00 files/a15.gif
7599 12-31-79 00:00 files/a16.gif
7581 12-31-79 00:00 files/a17.gif
7606 12-31-79 00:00 files/a18.gif
7613 12-31-79 00:00 files/a19.gif
7607 12-31-79 00:00 files/a2.gif
7592 12-31-79 00:00 files/a3.gif
7615 12-31-79 00:00 files/a4.gif
7618 12-31-79 00:00 files/a5.gif
7618 12-31-79 00:00 files/a6.gif
7578 12-31-79 00:00 files/a7.gif
7609 12-31-79 00:00 files/a8.gif
7603 12-31-79 00:00 files/a9.gif
57185 12-31-79 00:00 files/capsule.dae
310590 12-31-79 00:00 files/groundoverlay.jpg
224927 12-31-79 00:00 files/mechanism.dae
160728 12-31-79 00:00 files/shadowoverlay.jpg
33044 12-31-79 00:00 files/shed.dae
-------- -------
3310275 32 files
You can build this with java.util.zip, or even with jar
if you want.
As far as the images go, they should not be compressed, since they already contain compressed data. You don't get any significant savings.