Screenshot datatypes

class pygarmin.datatype.RGB(blue=0, green=0, red=0)

Bases: DataType

RGB is a sRGB format that uses 24 bits of data per per pixel.

Each color channel (blue, green, and red) is allocated 8 bits per pixel (BPP).


Return the color as bytearray.


Return an RGB tuple.

class pygarmin.datatype.Screenshot

Bases: DataType

Screenshot format.

The data structure seems to be derived from the Microsoft Windows Bitmap file format. The format contains three sections: a bitmap information header, a color palette, and the bitmap data. This resembles a DIB data structure.

The header isn’t one of the known DIB headers. It seems to provide information on the screen dimensions and color depth.

The color table is an array of structures that specify the red, green, and blue intensity values of each color in a color palette. Each pixel in the bitmap data stores a single value used as an index into the color palette. 1-, 4-, and 8-bit BMP files are expected to always contain a color palette. 16-, 24-, and 32-bit BMP files never contain color palettes. 16- and 32-bit BMP files contain bitfields mask values in place of the color palette. 2-bit BMP files were added for Windows CE (, but are not well supported.

The pixel array is a series of values representing either color palette indices or actual RGB color values. Pixels are packed into bytes and arranged as scan lines. In a BMP file, each scan line must end on a 4-byte boundary, so one, two, or three bytes of padding may follow each scan line. Scan lines are stored from the bottom up with the origin in the lower-left corner.

class pygarmin.datatype.ScreenshotHeader

Bases: Screenshot

class pygarmin.datatype.ScreenshotColor

Bases: Screenshot

class pygarmin.datatype.ScreenshotChunk

Bases: Screenshot