ImageGear v26.3 - Updated
Developer Guide / File Formats and Compressions / File Formats / File Formats Reference / BMP
In This Topic
    BMP
    In This Topic
    Full Name Microsoft Windows Bitmap
    Format ID ImGearFormats.BMP
    File Extension(s) *.bmp, *dib
    Data Type Raster Image
    Data Encoding Binary
    Multi-Page Support Only for OS/2 BMP
    Alpha Channel Support No
    Metadata Update Support Page

    ImageGear Supported Versions

    • Windows Bitmap version 5 (created for Windows 98, Windows 2000)
    • Windows Bitmap version 4 (created for Windows 95, Windows NT 4.0)
    • Windows Bitmap version 3 (created for Windows 3.x)
    • Windows Bitmap version 2 (created for Windows 2.x)
    • OS/2 Bitmap version 2
    • OS/2 Bitmap version 1

    ImageGear Supported Features

    • IGFilterFormatFlags.DETECTSUPPORT - autodetection
    • IGFilterFormatFlags.PAGEREADSUPPORT - single page file reading
    • IGFilterFormatFlags.PAGEINSERTSUPPORT - single-page file writing

    ImageGear Read Support

    • ImGearCompressions.NONE:
      • Indexed RGB: 1, 4, 8 bpp;
      • RGB: 15, 16, 24 bpp;
      • RGB + Alpha: 32 bpp.
    • ImGearCompressions.RLE:
      • Indexed RGB: 4, 8 bpp

    ImageGear Write Support

    • ImGearCompressions.NONE:
      • Indexed RGB: 1, 4, 8 bpp;
      • RGB: 24 bpp
    • ImGearCompressions.RLE:
      • Indexed RGB: 4, 8 bpp

    ImageGear Filter Control Parameters

    Filter Control Parameter Type Default Value Available Values Description
    UpsideDown bool false false, true If true then the images will be saved upside-down
    Type int 1 (BMI, MS Windows format) 0 (BMC, OS/2 1.x format)
    1 (BMI, MS Windows format),
    2 (BMI2, OS/2 2.x format).
    BMP type to use for saving.
    Scanner16GrayEnabbled bool false false, true Vidar 12-bit scanner options
    Scanner16GrayType int 0 0, 1 Vidar 12-bit scanner options: 0 a no particular scanner is specified. 1 a old VXR 12 scanner.

    Comments

    The BMP format for versions 2.x - 4.x contains two headers. All Windows bitmap files begin with the same first header. They proceed with a data structure containing image information (the Bitmap Information Header), and end with the actual image data. If there is a palette (1, 4, 8-bit images), it is located between the bitmap information and the bitmap image data.

    The first header identifies the format as BMP, and stores the file size and the address of the image. Two additional fields, Reserved1 and Reserved2, are not used and are set to 0.

    The second header, known as the "bitmap information header", varies across the versions of Windows bitmaps. The second header for all bitmaps from version 2.x to 5.x have in common the following basic set of information: size of the secondary header in bytes, height and width of the image in pixels, the number of bit planes, the number of bits per pixel, compression scheme (0 = uncompressed, 1 = 4-bit RLE compression, 2 = 8-bit RLE compression, 3 = bitfields encoding was used), size of image in bytes, horizontal and vertical resolution in pixels per meter, the number of colors in the image, and the minimum number of important colors.

    If the image is 16 or 32-bits per pixel in resolution, the compression field equals 3, and following the header are values for RedMask, GreenMask and BlueMask, rather than a palette. If the file is 4.x, there are values for an alpha component, color space type, x and y coordinates of red, green or blue endpoints, and gamma values for red, green, and blue coordinate scale values. The "ColorsImportant" field accommodates hardware that supports fewer colors than are contained by the image palette. The most significant colors are determined by counting their frequency of appearance. A value of zero means that all the colors in the image are significant.

    The palette, or color table, varies in size depending on the number of colors in the image. This value is stored in the "ColorsUsed" field of the Bitmap Information Header. In the BMP format v. 3, the palette's structure is in "RGBQUAD" format. See the section entitled "Palettes" in for more information. 24-bit images do not use a palette, but rather store the color information directly in the image data.

    References Used

    Brown, C. Wayne, and Barry J. Shepherd. Graphics File Formats: Reference and Guide. Greenwich, CT.: Manning Publications, 1992.

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