Imo file format

Imo file format is meant for storing intermediate results,
   and to have a standard fileformat for images (because X does not provide that).
Because it must be fast for intermediate results, it is not compressed,
   so it is not suitable for exchanging images over internet ;
   Jpeg and png are good choices for that.

An imo file is mainly an array of pixel-color data
   to which i added a small header at start of file, because
   requiring applications to read entire file to find sizes of image is too clumsy.
Additionally, it is possible to add free-style comments to end of file,
   which, if used, i recommend to be in 'variable=value' format,
   with variable/value pairs separated from eachother by newlines.

Header is defined like this :

typedef struct {
   char sig[4] ; /* should be 'imo0' */
   uint32_t byteorder ; /* should be 0x01020304 */
   uint32_t wi ;
   uint32_t hi ;
   int32_t offx ;
   int32_t offy ;
   float scalex ;
   float scaley ;
   } imoheader ;

Sig is intended for 'file' utility,
   so filetype can be recognized automatically, independent of filename extension.
Byteorder is a sanity check,
   for if an imofile is exchanged between systems that do not have same byteorder.
Wi and hi specify width and height of image ;
   these are most important part of header.
Offx and Offy specify offsets of this image in a (possibly hypothetical) 'master image'.
   This can be usefull when operating on a part of an image,
   result of which you want to put back where it's original came from,
   It is also usefull when working with geographical maps,
   in which case 'master image' is a hypothetical cylinder-projection of earth,
   and offsets make it possible to combine contents of multiple maps.
Scalex and scaley are also meant for use with geographical maps,
   so contents of maps that have different scales can be combined.
Datatype of scalex and scaley is 'float', but must fit in 32 bits
   so theoretically should be 'float32_t', but that doesn't exist.

Pixel-color data is defined as follows :

typedef struct {
   unsigned char o ; /* opacity */
   unsigned char r ; /* red */
   unsigned char g ; /* green */
   unsigned char b ; /* blue */
   } orgb ;

Opacity is complement of transparency ;
   if transparency is 255 (fully transparent) then opacity is 0
   and if opacity is 255 (fully opaque) then transparency is 0.
Red, green, and blue use full 0 - 255 range,
   255 indicating maximum intensity of that color component.

File consists of an imoheader followed by an array of orgb,
   and number of orgbs in array can be found from wi and hi fields in imoheader.
This way, entire file consists of 32-bit units.
Optionally, free-style comments can be added at end,
   which can be detected by comparing filesize with size needed for image.