In our current project, we are running into memory problems since we need to load too many image files. The current system is loading plain uncompressed Microsoft BMP files, so this is the obvious problem.
So, we are looking for a file format that
My first guess was PNG, but I am not sure if I can parse part of an image without decoding the whole file. Do you have any better idea or some experiences to share?
(My impression is that you are facing ram pressure rather than storage limitations - if I'm wrong about that please disregard this)
Compression will save storage space, but I don't think it's necessarily going to help (and could even be counterproductive) to reducing your ram footprint, since you (or at least the OS) end up copying compressed data into ram and then decompressing it to even more ram.
If you have a fairly raw bitmap format, it's a simple matter to calculate the file offset of any pixels of interest, and fseek() there and get a small amount of data. A packed format that combines the colors/channels together could be even better, especially if it's a format directly useful for your output (display or algorithm or whatever).
So a possibility would be to either identify an existing format that is, or write a routine for pre-processing images into a packed bitmap format directly usable by your output, and figure out how to make this a plug in to photoshop, or write a bulk converter tool plugged into whatever writes the flash cards or other storage devices used by your embedded system (you might look at coding it as an output driver to imagemagick in order to get that packages' input format flexibility). The embedded end of your code then becomes extremely simple and memory efficient since it only moves into ram the data it actually needs (modulo O/S buffered read size, but those buffers should get recycled behind the scenes)