]> GEM Bit Image - IMG
  •  Back 
  •  %Main 
  •  Index 
  •  Cross references 
  •  Help page 
  •  Show info about hypertext 
  •  View a new file 
Topic       : ATARI ST Picture formats
Author      : David Baggett/Jan K⌐upka
Version     : atari_gf.hyp 0.01 (17/09/96)
Subject     : Documentation/File formats
Nodes       : 52
Index Size  : 1328
HCP-Version : 3
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : 
@help       : 
@options    : -i -s +y +z
@width      : 75GEM Bit Image   *.IMG
1 wordword = 2 bytes
          version number of image file [1]
1 wordword = 2 bytes
          length of header in words [usually 8]
1 wordword = 2 bytes
          number of color planes [1 for monochrome]
1 wordword = 2 bytes
          pattern length in bytes [1-8, usually 2 for screen
1 wordword = 2 bytes
          pixel width in microns (1/1000 mm, 25400 microns per
1 wordword = 2 bytes
          pixel height in microns
1 wordword = 2 bytes
          line width in pixels
1 wordword = 2 bytes
          number of lines
? words         header length defined in 2nd wordword = 2 bytes
 of header
? bytes         data

  NOTES:  If the image is a color image (planes > 1), the planes are
stored separately starting with plane 0.  There is, however, no
standard way of storing the color palette.  Some programs may save
the palette in separate files, some may extend the header.  For this
reason, you should never assume the header is 8 words longlong = 4 bytes
, always
get the header length from the 2nd wordword = 2 bytes
 of the header.  Also, the
line width in the 7th wordword = 2 bytes
 is the number of pixels in a line.  Since
the data is encoded in byte-wide packets, the actual unpacked line
width is always a multiple of 8, and may be 1-7 pixels longer than
the length specified in the header.

For each byte x in the data section,
 x = 0           Pattern/scanline run.
                        Read the next byte, n (unsigned).
 If n > 0 then:
                                Read a number of bytes equal to the
                                length" wordword = 2 bytes
 in the header.  Repeat
                                pattern n times.
 If n = 0 then:
                                Scanline run.  Data for the next
                                is to be used multiple times.  Read
                                following record:
 1 byte          flag byte [$FF]
                                1 byte          number of times to use
                                                next scanline data
 The data for the next scanline follows,
                                compressed normally.
 x = 80 (hex)    Uncompressed bit string.  The next byte
                        determines the number of bytes to use
                        literally.  The literal data bytes follow.

 otherwise       Solid run.  The value of x determines
                        what to draw.  The high bit specifies whether
                        the pixels are set or cleared.  A 1 indicates
                        a byte-run using $FF, a 0 indicates a byte-run
                        using $00.  The low 7 bits, taken as an
                        quantity, specify the length of the run in