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. See
Header and 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. See
Image data.
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
Not described
The pages follow the Atari Compendium (appendix C), seasip.info, EGFF and the xloadimage source.
Known, not yet covered
- Viewer: there is no GEM IMG plugin yet.
- Reference: the Ventura Publisher ninth header word (meaning of a multi-plane colour or grey flag) comes from EGFF alone (header).
Unknown
- Reference: the layouts of the STTT, TIMG and HyperPaint variants: they are named by sources but no layout was found.
- Reference: how a pixel value maps to a VDI pen, and the units of the pixel size words (microns in the Compendium and EGFF, tenths of a millimetre on seasip.info) (header).
- Reference: whether a vertical replication count is the total number of lines (xloadimage and Netpbm) or the number of extra lines (EGFF reads “count 1 = two lines”) (image data).
Also used for
- Linux boot image – kernel8.img, zImage, uImage and Image: the files a boot loader loads to start Linux.
- Raw disk image – A disk or memory card copied byte for byte, with no header.
Links
Software
- GEM Paint – Digital Research’s paint program for the GEM desktop (MS-DOS, Atari ST)
- Ventura Publisher – desktop publishing program that ran on GEM and used GEM Image for pictures (MS-DOS)
- RECOIL – viewer and converter for retro computer pictures, including GEM Image (Windows, macOS, Linux, web browser)
Reference
- Atari Compendium, appendix C – the IMG header, the XIMG palette and the compression codes
- GEM IMG file format – John Elliott’s notes on the format as GEM Paint and Ventura write it