When I create an Image object from resource (a png file), does it internally convert it to a raw format (24-bit or device dependent format e.g. 555RGB) ? or does it convert it on the fly when drawing it ?
If it statically converts it to 24-bit raw format:
1) I can store the raw image on the resource since it is already being compressed by jar.
2) Draw it using drawRGB.
so there is no need to use png if I had custom palettized and raw image processing routines.
If it dynamically converts it to raw format, what is the performance consequences of this ? It must look up palette tables and convert it to device dependent format, that must be a little heavy process.
There is no "iron rule" on this but most phones will convert it to their native pixel format for speedier drawing. All Nokia phones do this. It is easy to find out if a phone does this by using the freeMemory() method in Runtime and seeing how much memory is used when you load a png (since a raw format will take up much more heap space).