What's the best way to compress and/or store image data so my J2ME midlet can access just small bits of the image without having to decompress the whole large image? (i.e. random access to small parts of compressed data - in this case image data)
I'm going to have various big image font files (i.e. an image with all the characters of certain languages laid out in grid format so I can render my own font on the Canvas) and I want to obviously get the individual character images off that to lay on the screen. I know about the general technique of using clipping for this, so no problems there. But the font image for certain languages will be big (from a few hundred to few thousand characters). I can't use Unicode and the built in fonts in the phone for various reasons I won't bother you with here.
So, is there some way of storing image data (PNG, or raw RGB, or any other format, even a custom format) that means I can pull out of the big data chunk just the character image data I want, without Java Mobile loading the whole image (or data) in to memory first? Part of the reason for this is it will be running on low end older phones with less memory and CPU.
So far I considered:
1.) Split large font image into several smaller images. Trouble is how many characters per image, and selecting quickly from the different smaller images without loading each one into memory and discarding it again, for every character.
2.) Use RGB data which is obviously very big for uncompressed image data, but zip-compress the data and then unzip bits I want using TinyLine's GZipInputStream http://tinyline.com/utils/index.html
Problem with this is presumably due to the zip algorithm it needs to get the whole data file in memory to unzip any part of it?
Also processor overhead in decompression and converting RGB data to J2ME Image.
The font image as a whole will be stored either on filesystem, or in RMS, or as a resource in the JAR.
Many thanks for any suggestions etc!