posted 06-16-2002 03:17 PM
Forget it. Zip software does it for you. I thought in some stupid way that I had come up with something new...What I had was this: TGA files are arranged like this: (sort-of)
pixel1 R value, pixel1 G value, pixel1 B value, pixel2 R value, pixel2 G value, pixel2 B value etc etc etc...
And I thought - hey, what if instead of writing the RGB values of a red pixel 84 times, why not write them once, and then an integer, 84? Well, I did it, and it worked, and the resulting file size was smaller.
(it's kind of like the difference between doing 3+3+3+3+3+3, or doing 3x6.)
So I very pleased with myself, until I zipped a regular .tga and a .tpak file generated by my program. They were both the same size. What had happened was that the .zip software was only able to conpress my .tpak file by 50%, and the .tga by 80%.
All I did was cheat WinZip out of some compression.