First, I would just like to say that I am a bit tired of quoting your stuff and commenting all of it so I just write it all clean here.
Next, I agree that it is no need for us to start a war, but I must admit that it is hard to avoid with your stubborness. You just repeat over and over what I have earlier said, paste stuff in from the PNG format which has little to do with tings and bring up other things that also has nothing to do with this things at all.
So, I take this again step by step.
1) Forget all about different types of palette, forgot that you can have true colors. We are talking about a normal palette here consiting of 16, 32, 64, 128 and 256 colors.
2) When you do tests, do it not once but 100 times and use realistic material that you would use in a real application.
3) For you information, so have I worked as a games programmer for small ang big companies for over 13 years (most with C/C++), where as over 2 of the last years includes developing proffesional games for the J2ME plattform. In other words, it is part of my DAILY work to do research and extensive tests on such things like we are discussing here so there are no need to send me code as I already have tons of it. Part of it is pasted in above.
4) Yuo neither do not need to paste in all kinds of things from the PNG fileformat coz I have most of it in the top of my head, so it is uncessary to bring things into this discussion that has nothing to do with the case.
5) We better keep to the case which is about 2 things; One where you claimed that palette data IS and HAVE TO be part of a header and second what methods is BEST to minimize JAR file.
And as answers to 5 and comments to your last posts:
First, you talk towards yourself, you claim that palette data (and YEAH we talk about plain normal 16, 32, 64, 128, 256 colors palette so stop draggin in all greyscales and 1 bits and true colors all the time) have to be part of the header. At the same time you say that PNG does not have any headers. Then you start to talk over and over again about headers. Then after mentioning headers and headers and headers, and after me explainng several times that there are no header in PNG format, only chunks, you explain that you mean chunck when you say header.
And that is fair enough but why do you still claim that palette data is part of the header and that it has to be?? The palette data is part of its chunk, not a header that PNG does not have.
My advice to you, extend your knowledge and look up one of the twos simplest graphics format around, the BMP and the PCX format. THEY have a header which describes the file and where to find the data, including where the palette data is located (which is NOT part of the header).... Then you can look up the 3DS format whihc uses CHUNKS the similiar way as PNG do. And learn the difference!
Of course, then you can just say that "I told you that when I said header, I ment chunk, so when I said that palette had to be part of the header, I ment that it had to be part of the chunk".... And no matter if that is true, it is just very silly to claim.... You are mixing 2 definitions which are NOT interchangable with each other.
But I admit, I did the same but in a very very different way which I also explained straight after you started to twist things around. I also used the word header when I talked about the desc fields for each chunk. I did this for simplisity instead of writing that all chunk desc fileds whihc is ment to describe the data in the the chunk take up roughly 40 bytes +/- (and NO the DATA, including palette data, is ONLY part of the chunk and NOT the chunk desc fields whihc only surronds the data it describes!), becuase I assumed that most people here is not to familiar with how the PNG format itself is defined.
What you do, is to twist things around. However, IF you mean the chunk DESC fields when you say HEADER, you are still wrong in that the palette data have to be part of it or is part of it. Of course the palette data have to be part of the chunk, thats obvious, that is what the palette chunk is for! However, claiming, becuase of this, that is part of what you call header is false information because it is not.
To make a very simply example, which is NOT taken from PNG, just to illustrate what a chunk really is...... So, to put PNG format aside and lets say we have our own format with PALS, IMGS and CEND fields for indicating start of palette data and start of image data... THe file could be something like this:
41424344 // SIGNATURE (ABCD)
PALS // START OF PALETTE DATA CHUNK
0020 // NUMBER OF COLORS (32) (THIS FIELD IS EVEN NOT NECESSARY, JUST READ TO ENDC AND COUNT)
// AND HERE COMES THE PALETTE DATA!
000000 // COLOR 0 IN RGB
001F00 // COLOR 1 IN RGB
FFFFFF // COLOR 31 IN RGB
// END OF PALETTE DATA
CEND // END OF CHUNK
IMGS // START OF IMAGE CHUNK
0040 // WIDTH OF IMAGE
0020 // HEIGHT OF IMAGE
// START OF IMAGE DATA
// END OF IMAGE DATA
In this format there are NO headers and there do not need to be any because it is bulild as chunks that you just read chunk by chunk....
With a header, you would have done something like this:
41424345 // SIGNATURE
000C // SIZE OF HEADER
0040 // WIDTH
0020 // HEIGHT
0020 // NUM OF COLORS
// HERE COMES IMAGE DATA