I’ve discovered a method to compress my gif images from 2 kb down to mere ~200 bytes, and even strip away some Java code that does the getImage(), and hence maybe strip down those 2kb’s in my 4kb project down to 0kb.
I’ll simply define the images in a text file;
a) First line being the colors
b) All lines except 1st line will be pixels for seperate images.
Example, 4 color images.
Colors=0,0,0 234,234,123 94,38,123, 0,0,45 (R,G,B colors seperated by a whitespace character)
Image1=0032424312003242431200324243120032424312003242431200324243122341 (8x8 image, each decimal value represent a index in the color “table”)
Here’s how I would do it:
F03F8590CU2Z (I’ll be using the ascii value of those to represent numbers from 0-255)
0032424312003242431200324243120032424312003242431200324243122341
1210000012231023041023012302022020230031030401230123012303204012
0032424312003242431200324243120032424312003242431200324243122341
1210000012231023041023012302022020230031030401230123012303204012
0032424312003242431200324243120032424312003242431200324243122341
1210000012231023041023012302022020230031030401230123012303204012
0032424312003242431200324243120032424312003242431200324243122341
1210000012231023041023012302022020230031030401230123012303204012
Those are a few 8x8 4 colors images, if they were GIF they would take up a lot of space. But since that’s a text file, it will get compressed A LOT in the JAR file, I’ve tested this method and it takes 4 32x32 8 color images from 1,5k down to mere 180 bytes, and I’ll also save an overhead in the javacode since I only need to read a text file, and not images.