
| 拡張子 Extension | .bmp |
|---|---|
| MIME Type MIME Type | image/x-ms-bmp (非公式) image/x-ms-bmp (unofficial) |
| タイプコード Typecode | 'BMP ' 'BMP' 'BMPf' 'BMPf' 'BMPp' 'BMPp' |
| UTI UTI | com.microsoft.bmp com.microsoft.bmp |
| マジックナンバー Magic | BM BM |
| 開発者 Developers | マイクロソフト Microsoft |
| 種別 Article | ビットマップ 画像 Map image bit |
BMP (ビーエムピー、Microsoft Windows B it m a p Image)またはDIB (ディーアイビー、 D evice I ndependent B itmap、デバイス独立ビットマップ)は、 マイクロソフトとIBMがWindowsとOS/2にわかれる前のOSを共同で開発していた頃に作られた画像ファイル形式。 BMP (Biemupi, Microsoft Windows B it m a p Image) or DIB (Diaibi, D evice I ndependent B itmap, device-independent bitmap), and Microsoft IBM that Windows and OS / 2 Wakareru before the OS co image file format was created in the time was developing. 圧縮の方法についても定義されているが、Windowsが標準では無圧縮のファイルを生成するため、他のアプリケーションにおいても無指定時は、 圧縮はされていない場合が多い。 That are also defined how to compression, Windows by default is to generate uncompressed files, even when given no other applications, compression is often not the case.
ファイル形式の細部の変更が何度か行われており、その結果としてWindowsとOS/2で多少ファイル形式が異なることがある。 Has made several minor changes to the file format, as a result of its Windows and OS / 2 file format may vary slightly.
機械独立のファイル形式として設計されたため、実際に存在する画像表示装置や、印刷装置が、画像を上方から処理するものがほぼ全てであるにもかかわらず、 幾何学的なX軸、Y軸方向に座標を指定する形式となっている。 Was designed for machine-independent file format, and an actual image display device, printing device, despite the fact that almost all the image processing from the above, and of a geometric axis X, Y axis The format is to specify the coordinates. その結果、画像を下から上に向かって記録している (Bottom up)のが特徴であるが、後に高さに負の値を指定することでその他大多数の画像ファイル形式と同じように画像を上から下へ向かって記録する (Top down)こともできるようになった。 As a result, the recorded images from the bottom toward the top (Bottom up) that is characteristic of the image like most other image file formats by specifying a negative value to the height later To record from top to bottom (Top down) can now. しかし互換性の面からProgramming Windowsではトップダウン形式のビットマップの作成を推奨していない。 Programming Windows in terms of compatibility but not recommended to create a bitmap in the top-down style.
目次 Contents |
ビットマップファイルは、以下のブロックに分かれている。 Bitmap is divided into the following block.
| BITMAPFILEHEADER構造体 BITMAPFILEHEADER structure |
| BITMAPCOREHEADER構造体 BITMAPCOREHEADER structure |
| RGBTRIPLE構造体(インデックスカラー時) RGBTRIPLE structure (when the color index) |
| 画像データ Image Data |
| BITMAPFILEHEADER2構造体 BITMAPFILEHEADER2 structure |
| BITMAPINFOHEADER2構造体 BITMAPINFOHEADER2 structure |
| (要加筆) [1] (インデックスカラー時) (Categories necessary) [1] (when the color index) |
| 画像データ Image Data |
| BITMAPFILEHEADER構造体 BITMAPFILEHEADER structure |
| BITMAPINFOHEADER構造体 BITMAPINFOHEADER structure |
| RGBQUAD構造体(インデックスカラー時) RGBQUAD structure (when the color index) |
| 画像データ Image Data |
| BITMAPFILEHEADER構造体 BITMAPFILEHEADER structure |
| BITMAPV4HEADER構造体 BITMAPV4HEADER structure |
| RGBQUAD構造体(インデックスカラー時) RGBQUAD structure (when the color index) |
| 画像データ Image Data |
| BITMAPFILEHEADER構造体 BITMAPFILEHEADER structure |
| BITMAPV5HEADER構造体 BITMAPV5HEADER structure |
| RGBQUAD構造体(インデックスカラー時) RGBQUAD structure (when the color index) |
| 画像データ Image Data |
14byteからなる、ビットマップファイルのファイルヘッダである。 14byte be from the bitmap file header.
| オフセット Offset | サイズ Size | 格納する情報 Information stored | 値・備考 Note value |
| 0x0000 0x0000 | 2 バイト 2 bytes | ファイルタイプ File Type | 常にBM(0x42,0x4d) ( マジックナンバー ) Always BM (0x42, 0x4d) (No. magic) |
| 0x0002 0x0002 | 4 バイト 4 bytes | ファイルサイズ Size | ビットマップファイルのサイズを格納する(単位はバイト)。 Store the size of the bitmap file (in bytes). |
| 0x0006 0x0006 | 2 バイト 2 bytes | 予約領域1 Reserved Area 1 | 常に0 Always 0 |
| 0x0008 0x0008 | 2 バイト 2 bytes | 予約領域2 Reserved Area 2 | 常に0 Always 0 |
| 0x000a 0x000a | 4 バイト 4 bytes | オフセット Offset | ファイルヘッダの先頭アドレスからビットマップデータの先頭アドレスまでのオフセット(単位はバイト)。 Address offset to the top of the header address from the top of the bitmap file (in bytes). |
参考URL http://msdn.microsoft.com/en-us/library/dd183374(VS.85).aspx Reference URL Http://Msdn.microsoft.com/En-Us/Library/Dd183374 (VS.85). Aspx
このブロックは、アプリケーションが画像を描画するための画像の詳細な情報が書かれており、14バイト目から始まる。 This block has been written for information to draw a picture of the image of the application, starting at 14 bytes.
40 - Windows V3 40 - Windows V3 108 - Windows V4 108 - Windows V4 124 - Windows V5 124 - Windows V5 12 - OS/2 V1 12 - OS / 2 V1 64 - OS/2 V2 64 - OS / 2 V2
OS/2のビットマップで使われる情報ヘッダで、12バイトある。 OS / 2 header information used in the bitmap, in 12 bytes.
| オフセット Offset | サイズ Size | 格納する情報 Information stored | 値・備考 Note value |
| 0x000e 0x000e | 4 バイト 4 bytes | ヘッダサイズ Size header | 12 12 |
| 0x 0x | 2 バイト 2 bytes | ビットマップの横幅 Width of the bitmap | 単位はピクセル In pixels |
| 0x 0x | 2 バイト 2 bytes | ビットマップの縦幅 Height of the bitmap | 単位はピクセル In pixels |
| 0x 0x | 2 バイト 2 bytes | プレーン数※昔、EGAやVGAディスプレイカードで使われていた概念で、現在は全く使われない。 ※ Number of plain old, EGA or VGA card concept was used in the display is currently not used at all. | 常に1 Always |
| 0x 0x | 2 バイト 2 bytes | 1ピクセルあたりのビット数 Number of bits per pixel | 1,4,8,24 1,4,8,24 |
参考URL http://msdn.microsoft.com/en-us/library/dd183372(VS.85).aspx http://www.programmers@heaven.com/mb/graphics/148346/152845/re-planes/?S=B20000 (スパムフィルターに引っかかるためアドレスに@を入れています。@を除くこと) Reference URL Http://Msdn.microsoft.com/En-Us/Library/Dd183372 (VS.85). Aspx Http://Www.programmers @ Heaven.com/Mb/Graphics/148346/152845/Re-Planes / ? S = B20000 (address to get caught in spam filters are put @. @ to remove)
Windowsのビットマップで使われる情報ヘッダで、40バイトある。 The information used in the Windows bitmap header, 40 bytes. 多くのビットマップがこの形式で保存されている。 Has been saved in this format many bitmaps.
| オフセット Offset | サイズ Size | 格納する情報 Information stored | 値・備考 Note value |
| 0x000e 0x000e | 4 バイト 4 bytes | ヘッダサイズ Size header | 40 40 |
| 0x 0x | 4 バイト 4 bytes | ビットマップの横幅 Width of the bitmap | 単位はピクセル In pixels |
| 0x 0x | 4 バイト 4 bytes | ビットマップの縦幅 Height of the bitmap | 単位はピクセル In pixels |
| 0x 0x | 2 バイト 2 bytes | プレーン数 Number of planes | 常に1 Always |
| 0x 0x | 2 バイト 2 bytes | 1ピクセルあたりのビット数 Number of bits per pixel | 0,1,4,8,16,24,32 0,1,4,8,16,24,32 |
| 0x 0x | 4 バイト 4 bytes | 圧縮形式 Compression | 0,1,2,3,4,5 ※1 0,1,2,3,4,5 ※ 1 |
| 0x 0x | 4 バイト 4 bytes | 画像データサイズ Image data size | 単位はバイト In bytes |
| 0x 0x | 4 バイト 4 bytes | 水平方向の解像度 Horizontal resolution | 単位はピクセル/m In pixels / m |
| 0x 0x | 4 バイト 4 bytes | 垂直方向の解像度 Vertical resolution | 単位はピクセル/m In pixels / m |
| 0x 0x | 4 バイト 4 bytes | 使用する色数 Of colors used | ビットマップで実際に使用するカラーパレット内のカラーインデックスの数。 Number of colors in the color palette index actually used in the bitmap. |
| 0x 0x | 4 バイト 4 bytes | 重要な色数 Number of important colors | ビットマップを表示するために必要なカラーインデックスの数。 Number of color index required to display a bitmap. |
参考URL http://msdn.microsoft.com/en-us/library/dd183376(VS.85).aspx Reference URL Http://Msdn.microsoft.com/En-Us/Library/Dd183376 (VS.85). Aspx
OS/2 V2以降対応した、新しい情報ヘッダで、64byteある。 OS / 2 V2 compatible since the new information in the header, 64byte there. [2] [2]
Windows 95、Windows NT 4.0から対応した新しい情報ヘッダ。 Windows 95, Windows NT 4.0 supports the new information from the header.
| オフセット Offset | サイズ Size | 格納する情報 Information stored | 値・備考 Note value |
| 0x000e 0x000e | 4 バイト 4 bytes | ヘッダサイズ Size header | 108 108 |
| 0x 0x | 4 バイト 4 bytes | ビットマップの横幅 Width of the bitmap | 単位はピクセル In pixels |
| 0x 0x | 4 バイト 4 bytes | ビットマップの縦幅 Height of the bitmap | 単位はピクセル In pixels |
| 0x 0x | 2 バイト 2 bytes | プレーン数 Number of planes | 常に1 Always |
| 0x 0x | 2 バイト 2 bytes | 1ピクセルあたりのビット数 Number of bits per pixel | 0,1,4,8,16,24,32 0,1,4,8,16,24,32 |
| 0x 0x | 4 バイト 4 bytes | 圧縮形式 Compression | 0,1,2,3,4,5 ※1 0,1,2,3,4,5 ※ 1 |
| 0x 0x | 4 バイト 4 bytes | 画像データサイズ Image data size | 単位はバイト In bytes |
| 0x 0x | 4 バイト 4 bytes | 水平方向の解像度 Horizontal resolution | 単位はピクセル/m In pixels / m |
| 0x 0x | 4 バイト 4 bytes | 垂直方向の解像度 Vertical resolution | 単位はピクセル/m In pixels / m |
| 0x 0x | 4 バイト 4 bytes | 使用する色数 Of colors used | ビットマップで実際に使用するカラーパレット内のカラーインデックスの数。 Number of colors in the color palette index actually used in the bitmap. |
| 0x 0x | 4 バイト 4 bytes | 重要な色数 Number of important colors | ビットマップを表示するために必要なカラーインデックスの数。 Number of color index required to display a bitmap. |
| 0x 0x | 4 バイト 4 bytes | 赤成分のカラーマスク Mask red color component | |
| 0x 0x | 4 バイト 4 bytes | 緑成分のカラーマスク Component masks the green color | |
| 0x 0x | 4 バイト 4 bytes | 青成分のカラーマスク Mask and blue color components | |
| 0x 0x | 4 バイト 4 bytes | α成分のカラーマスク mask color component α | |
| 0x 0x | 4 バイト 4 bytes | 色空間 Colorspace | 0 0 |
| 0x 0x | 36 バイト 36 bytes | CIEXYZTRIPLE構造体 CIEXYZTRIPLE structure | |
| 0x 0x | 4 バイト 4 bytes | 赤成分のガンマ値 Gamma value for red component | |
| 0x 0x | 4 バイト 4 bytes | 緑成分のガンマ値 Gamma value for green component | |
| 0x 0x | 4 バイト 4 bytes | 青成分のガンマ値 Gamma value for blue component |
参考URL http://msdn.microsoft.com/en-us/library/dd183380(VS.85).aspx Reference URL Http://Msdn.microsoft.com/En-Us/Library/Dd183380 (VS.85). Aspx
Windows 98、Windows 2000から対応した新しい情報ヘッダ。 Windows 98, Windows 2000 for new information from the header.
| オフセット Offset | サイズ Size | 格納する情報 Information stored | 値・備考 Note value |
| 0x000e 0x000e | 4 バイト 4 bytes | ヘッダサイズ Size header | 124 124 |
| 0x 0x | 4 バイト 4 bytes | ビットマップの横幅 Width of the bitmap | 単位はピクセル In pixels |
| 0x 0x | 4 バイト 4 bytes | ビットマップの縦幅 Height of the bitmap | 単位はピクセル In pixels |
| 0x 0x | 2 バイト 2 bytes | プレーン数 Number of planes | 常に1 Always |
| 0x 0x | 2 バイト 2 bytes | 1ピクセルあたりのビット数 Number of bits per pixel | 0,1,4,8,16,24,32 0,1,4,8,16,24,32 |
| 0x 0x | 4 バイト 4 bytes | 圧縮形式 Compression | 0,1,2,3,4,5 ※1 0,1,2,3,4,5 ※ 1 |
| 0x 0x | 4 バイト 4 bytes | 画像データサイズ Image data size | 単位はバイト In bytes |
| 0x 0x | 4 バイト 4 bytes | 水平方向の解像度 Horizontal resolution | 単位はピクセル/m In pixels / m |
| 0x 0x | 4 バイト 4 bytes | 垂直方向の解像度 Vertical resolution | 単位はピクセル/m In pixels / m |
| 0x 0x | 4 バイト 4 bytes | 使用する色数 Of colors used | ビットマップで実際に使用するカラーパレット内のカラーインデックスの数。 Number of colors in the color palette index actually used in the bitmap. |
| 0x 0x | 4 バイト 4 bytes | 重要な色数 Number of important colors | ビットマップを表示するために必要なカラーインデックスの数。 Number of color index required to display a bitmap. |
| 0x 0x | 4 バイト 4 bytes | 赤成分のカラーマスク Mask red color component | |
| 0x 0x | 4 バイト 4 bytes | 緑成分のカラーマスク Component masks the green color | |
| 0x 0x | 4 バイト 4 bytes | 青成分のカラーマスク Mask and blue color components | |
| 0x 0x | 4 バイト 4 bytes | α成分のカラーマスク mask color component α | |
| 0x 0x | 4 バイト 4 bytes | 色空間 Colorspace | 0,0x73524742,0x57696e20,0x4c494e4b,0x4d424544 0,0 x73524742, 0x57696e20, 0x4c494e4b, 0x4d424544 |
| 0x 0x | 36 バイト 36 bytes | CIEXYZTRIPLE構造体 CIEXYZTRIPLE structure | |
| 0x 0x | 4 バイト 4 bytes | 赤成分のガンマ値 Gamma value for red component | |
| 0x 0x | 4 バイト 4 bytes | 緑成分のガンマ値 Gamma value for green component | |
| 0x 0x | 4 バイト 4 bytes | 青成分のガンマ値 Gamma value for blue component | |
| 0x 0x | 4 バイト 4 bytes | レンダリングの意図 Rendering intent | 1,2,4,8 1,2,4,8 |
| 0x 0x | 4 バイト 4 bytes | プロファイルデータのオフセット Offset profile data | 情報ヘッダの先頭アドレスからプロファイルデータの先頭アドレスまでのオフセット。 Address offset to the top of the profile data from the top of the header address information. 単位はバイト In bytes |
| 0x 0x | 4 バイト 4 bytes | プロファイルデータのサイズ Size of profile data | 単位はバイト In bytes |
| 0x 0x | 4 バイト 4 bytes | 予約領域 Reserved area | 常に0 Always 0 |
参考URL http://msdn.microsoft.com/en-us/library/dd183381(VS.85).aspx Reference URL Http://Msdn.microsoft.com/En-Us/Library/Dd183381 (VS.85). Aspx
※1 数字と定義されている圧縮形式の関係は以下の通り ※ 1 compression format that is relevant numbers and definitions are as follows
0 - 無圧縮 (識別子はBI_RGB) 0 - No Compression (identifier BI_RGB) 1 - 8ビット/ピクセルRLE (識別子はBI_RLE8) 1 - 8 bits / pixel RLE (identifier BI_RLE8) 2 - 4ビット/ピクセル RLE (識別子はBI_RLE4) 2 - 4 bits / pixel RLE (identifier BI_RLE4) 3 - ビットフィールド (識別子はBI_BITFIELDS) 3 - bit field (identifier BI_BITFIELDS) 4 - JPEG画像 (識別子はBI_JPEG) 4 - JPEG Image (identifier BI_JPEG) 5 - PNG画像 (識別子はBI_PNG) 5 - PNG images (identifier BI_PNG)
このブロックは、画像内で使用される色を定義している。 This block is used to define the colors in the image. 上述の通り、ビットマップ画像はピクセルごとに保存されている。 As mentioned above, a bitmap image is stored for each pixel. 各ピクセルは、1バイト以上を使用して値を保持している。 Each pixel is one that holds the value of using more than one byte. したがって、各値と実際の色の関係を、アプリケーションに教えることがカラーパレットの目的である。 Therefore, the relationship between each value and the actual color, the color palette is the purpose of teaching the application.
典型的なビットマップファイルはRGBカラーモデルを使用している。 Bitmap is a classic that is using the RGB color model. このモデルにおいて、色は赤 (R)、 緑 (G)、 青 (B)のそれぞれの強さ(0-255)で表される。 In this model, the colors red (R), green (G), blue (B) the strength of each of the (0-255) is represented by.
1色3バイトで表記する形式 Written in the form of three bytes per color
| バイト数 Bytes | 情報 Information | 値・備考 Note value |
| 1 byte 1 byte | 青 Blue | 0-255 255 |
| 1 byte 1 byte | 緑 Green | 0-255 255 |
| 1 byte 1 byte | 赤 Red | 0-255 255 |
1色4バイトで表記する形式 Written in one color to four-byte format
| バイト数 Bytes | 情報 Information | 値・備考 Note value |
| 1 byte 1 byte | 青 Blue | 0-255 255 |
| 1 byte 1 byte | 緑 Green | 0-255 255 |
| 1 byte 1 byte | 赤 Red | 0-255 255 |
| 1 byte 1 byte | 予約領域 Reserved area |
このブロックは、イメージを各ピクセルごとに記述する。 This block to describe each pixel in the image. ピクセルは通常左から右へ、下から上に向かって保存されている。 Pixel is usually left to right, are saved from the bottom upward. 各ピクセルは1バイト以上で記述されている。 Each pixel is described by one or more bytes. もし水平方向のバイト数が4の倍数ではないときは、 ヌル (0x00)で埋めて4の倍数にする。 The number of bytes in the horizontal direction if 4 if not a multiple of the null (0x00) to fill in a multiple of 4.
