Download the tool.
Java source included. Anyone can use it however you like, except copyrighting it.
I forget when, but a couple years ago I created a tool for EB2 that would compress those TGA images that would get sufficiently reduced space by compressing, to reduce the size of the release. I dusted it off recently and thought I'd put it out there for anyone else to use for their mods.
You need to have Java installed, and you need to change runConversion.bat to point to your mod.
What it does is fairly straightforward:
1 Run through the full mod structure
2 Investigate files ending with .tga
2a Skip already compressed files
2b Write a compressed file to replace the fullsize one
Example of its logging, to demonstrate what it can do:
Originally Posted by tga compressor
As you can see, individual files can gain a reduction in size of up to 99% in the best of cases, but may even turn out a few bytes LARGER than uncompressed in the worst of them. This is because this version is modified to not do any estimating of gain before compressing. This saves literally hours of time when there are many images that would not benefit much, as they need to be fully read and inspected for the estimation.
The size reduction gets realized when neighbouring pixels have the same colour ("run length encoding", meaning instead of RED RED RED RED RED it writes 5RED). Many images have a fair bit of "transparent" in them which is typically clustered together and gets excellent compression, and those map images you can see marked blue similarly have a ton of neighbouring pixels with the same colour. When hardly any pixels are the same as their neighbours, the control markers for the compression adds to the file size with no or almost no gain, but thankfully they are only a few bytes dead weight.
NB! Your images will get overwritten as part of this process. If there is a bug in the tool (not found as part of EB2's use), they will be essentially destroyed. You should definitely have a backup handy (either as a full copy of your files or checked into some kind of version control) if it fails on your images.
Note that if you kill the process while it is currently compressing, that file will be corrupted! Killing the process while reading a file is okay.