ImageGear for C and C++ on Linux v19.10 - Updated
GEM
User Guide > File Formats and Compressions > File Formats > File Formats Reference > GEM

Full Name GEM Raster
Format ID IG_FORMAT_GEM = 13
File Extension(s) *.gem
Data Type Raster image
Data Encoding Binary
Color Profile Support No
Multi-Page Support No
Alpha Channel Support No
ImageGear Platforms Support WIN32, WIN64, Unix, Unix64, .NET, .NET64, MAC

ImageGear Supported Versions:

N/A

ImageGear Supported Features:

ImageGear Read Support:

IG_COMPRESSION_RLE - 1, 4, 8 bpp

ImageGear Write Support:

None

ImageGear Filter Control Parameters:

None

Comments:

A deal with the creators of Ventura Publisher made this a significant format in the desktop publishing arena. It was also distributed by PC systems manufacturers and was the native bitmap format of the Atari ST system.

The structure of a GEM Raster image file begins with a fixed-length header and is followed by the bitmap data.

The data fields of the header include the version number (always 1), image width (in pixels), and image height (in scan lines). A field named "Headerlength" contains a value of either 8 or 9, where 9 indicates that an optional field appears at the end, called "BitImageFlag". This field is directly tied with a "NumberOfPlanes" field. If "NumberOfPlanes" is greater than 1, the BitImageFlag indicates whether the image is color or grayscale. (BitImageFlag = 0 = color, BitImageFlag = 1 = grayscale).

Two fields in the header that are a little unusual among bitmap formats are the width and height of the pixels (in microns), and a field called "PatternLength". PatternLength is the length of any pattern that will be decoded. It is used by the RLE compression scheme, which assigns one of four different kind of codes to store each of the four different types of repeat data in the image. The "pattern code" indicates that a pattern is available. The pattern and repeat count are decoded while reading the file.

For more on RLE compression, see the ImageGear Supported Compressions Reference section.

References Used

Murray, James D. and William vanRyper. Encyclopedia of Graphics File Formats. Sebastopol, CA: O'Reilly & Associates, Inc., 1994.