Introduction
GEM Image is the bitmap format of GEM, the graphical desktop from Digital Research that ran on MS-DOS PCs and was built into the Atari ST. It was the picture format of GEM Paint and of Ventura Publisher, and many Atari ST programs read and write it.
The original format holds one or more bitplanes without a palette, so colour files
depend on the screen they were made on. A later extension, XIMG, adds a palette to the
header. The .img extension is shared with disk images and other formats,
so a reader has to check the header.
Structure
The header is a list of big-endian 16-bit words: the version, the header length in
words (usually 8), the number of bitplanes, the pattern length in bytes, the pixel
width and height in microns, the image width in pixels and the number of lines. A
longer header can follow with more data; in an XIMG file it starts with the letters
XIMG and holds the palette.
The pixels come next, line by line and plane by plane, compressed with a few simple
codes. A byte 00 with a count starts a pattern run, which repeats the next
pattern-length bytes. The sequence 00 00 FF with a count repeats the
whole next line that many times. A byte 80 with a count is followed by
that many literal bytes. Any other byte is a solid run: its top bit gives the colour,
all set or all clear, and the low seven bits the number of bytes.
0Version, header length, planes, pattern length8 bytes8Pixel size in microns, width, lines8 bytes16Extended header such as XIMG (optional)varies…Lines each plane run-length encodedvaries
Also used for
- Raw disk image .img
Links
Software
- GEM Paint (MS-DOS, Atari ST)
- Ventura Publisher (MS-DOS)
- RECOIL (Windows, macOS, Linux, web browser)