ビットマップ【bitmap】
読み方:びっとまっぷ
ビー‐エム‐ピー【BMP】
ビットマップ
BMP
読み方:ビーエムピー
別名:ビットマップ
BMPとは、Windowsにおける標準的な画像の保存形式のことである。ビットマップ形式と呼ばれることも多い。
JPEGやPNGが圧縮保存するファイル形式であるのに対して、BMPでは基本的に無圧縮のままファイルを生成する。そのため画質の劣化がない。ただし無圧縮につきデータ容量が膨大になる難点もある。あるいは、色数を削減して、圧縮した上で保存することも可能である。白と黒のモノクロ2値から、16色、256色、1677万7216色(フルカラー)までを設定することが可能である。
BMP形式で保存されたファイルには、「.bmp」という拡張子がつく。
BMPは非圧縮形式なので高度な画像が再現できるが、印刷に適したCMYK色の発色方式には対応していないので、DTPに向いているともいえない。
画像ファイル形式: | APNG アニメーションGIF インターレースGIF BMP CIFF Exif GIF |
Bitmap クラス
アセンブリ: System.Drawing (system.drawing.dll 内)

<SerializableAttribute> _ <ComVisibleAttribute(True)> _ Public NotInheritable Class Bitmap Inherits Image


System.MarshalByRefObject
System.Drawing.Image
System.Drawing.Bitmap


Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Bitmap コンストラクタ (String)
アセンブリ: System.Drawing (system.drawing.dll 内)



このファイルは Bitmap が破棄されるまでロックされます。
GDI+ デコーダには制約があるので、65,535 ピクセルよりも大きい 1 次元の .png イメージ ファイルからビットマップを作成した場合、System.ArgumentException がスローされます。

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Bitmap コンストラクタ (Image)
アセンブリ: System.Drawing (system.drawing.dll 内)


Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Bitmap コンストラクタ (Stream, Boolean)
アセンブリ: System.Drawing (system.drawing.dll 内)



Bitmap の有効期間の間は、このストリームを開いておく必要があります。
GDI+ デコーダには制約があるので、65,535 ピクセルよりも大きい 1 次元の .png イメージ ファイルからビットマップを作成した場合、System.ArgumentException がスローされます。

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Bitmap コンストラクタ (Stream)
アセンブリ: System.Drawing (system.drawing.dll 内)



Bitmap の有効期間の間は、このストリームを開いておく必要があります。
GDI+ デコーダには制約があるので、65,535 ピクセルよりも大きい 1 次元の .png イメージ ファイルからビットマップを作成した場合、System.ArgumentException がスローされます。

ビットマップをストリームから読み込む方法を次のコード例に示します。
この例は、Windows フォームでの使用を意図してデザインされています。PictureBox1 という名前の PictureBox を格納するフォームを作成します。コードをフォームに貼り付けて、InitializeStreamBitmap メソッドをフォームのコンストラクタ 、または Load イベント処理メソッドから呼び出します。
Private Sub InitializeStreamBitmap() Try Dim request As System.Net.WebRequest = _ System.Net.WebRequest.Create( _ "http://www.microsoft.com//h/en-us/r/ms_masthead_ltr.gif") Dim response As System.Net.WebResponse = request.GetResponse() Dim responseStream As System.IO.Stream = response.GetResponseStream() Dim bitmap2 As New Bitmap(responseStream) PictureBox1.Image = bitmap2 Catch ex As System.Net.WebException MessageBox.Show("There was an error opening the image file. Check the URL") End Try End Sub
private void InitializeStreamBitmap() { try { System.Net.WebRequest request = System.Net.WebRequest.Create( "http://www.microsoft.com//h/en-us/r/ms_masthead_ltr.gif"); System.Net.WebResponse response = request.GetResponse(); System.IO.Stream responseStream = response.GetResponseStream(); Bitmap bitmap2 = new Bitmap(responseStream); PictureBox1.Image = bitmap2; } catch(System.Net.WebException) { MessageBox.Show("There was an error opening the image file." + "Check the URL"); } }
void InitializeStreamBitmap() { try { System::Net::WebRequest^ request = System::Net::WebRequest::Create( "http://www.microsoft.com//h/en-us/r/ms_masthead_ltr.gif" ); System::Net::WebResponse^ response = request->GetResponse(); System::IO::Stream^ responseStream = response->GetResponseStream(); Bitmap^ bitmap2 = gcnew Bitmap( responseStream ); PictureBox1->Image = bitmap2; } catch ( System::Net::WebException^ ) { MessageBox::Show( "There was an error opening the image file." "Check the URL" ); } }
private void InitializeStreamBitmap() { try { System.Net.WebRequest request = System.Net.WebRequest.Create( "http://www.microsoft.com//h/en-us/r/ms_masthead_ltr.gif"); System.Net.WebResponse response = request.GetResponse(); System.IO.Stream responseStream = response.GetResponseStream(); Bitmap bitmap2 = new Bitmap(responseStream); pictureBox1.set_Image(bitmap2); } catch (System.Net.WebException exp) { MessageBox.Show(("There was an error opening the image file." + "Check the URL")); } } //InitializeStreamBitmap

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Bitmap コンストラクタ (Int32, Int32, Int32, PixelFormat, IntPtr)
アセンブリ: System.Drawing (system.drawing.dll 内)

Public Sub New ( _ width As Integer, _ height As Integer, _ stride As Integer, _ format As PixelFormat, _ scan0 As IntPtr _ )
Dim width As Integer Dim height As Integer Dim stride As Integer Dim format As PixelFormat Dim scan0 As IntPtr Dim instance As New Bitmap(width, height, stride, format, scan0)
public function Bitmap ( width : int, height : int, stride : int, format : PixelFormat, scan0 : IntPtr )


- SecurityPermission (アンマネージ コードを呼び出すために必要なアクセス許可)。UnmanagedCode (関連する列挙体)

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Bitmap コンストラクタ (Image, Size)
アセンブリ: System.Drawing (system.drawing.dll 内)



Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Bitmap コンストラクタ (String, Boolean)
アセンブリ: System.Drawing (system.drawing.dll 内)



このファイルは Bitmap が破棄されるまでロックされます。
GDI+ デコーダには制約があるので、65,535 ピクセルよりも大きい 1 次元の .png イメージ ファイルからビットマップを作成した場合、System.ArgumentException がスローされます。

GetPixel および SetPixel メソッドを使用して、イメージの色を変更する方法を次のコード例に示します。また、この例では PixelFormat プロパティも使用しています。
この例は、Label1 という名前の Label、PictureBox1 という名前の PictureBox、および Button1 という名前の Buttonを含んだ Windows フォームでの使用を意図してデザインされています。コードをフォームに貼り付け、Button1_Click メソッドをボタンの Click イベントに関連付けます。
Dim image1 As Bitmap Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click Try ' Retrieve the image. image1 = New Bitmap( _ "C:\Documents and Settings\All Users\Documents\My Music\music.bmp", _ True) Dim x, y As Integer ' Loop through the images pixels to reset color. For x = 0 To image1.Width - 1 For y = 0 To image1.Height - 1 Dim pixelColor As Color = image1.GetPixel(x, y) Dim newColor As Color = _ Color.FromArgb(pixelColor.R, 0, 0) image1.SetPixel(x, y, newColor) Next Next ' Set the PictureBox to display the image. PictureBox1.Image = image1 ' Display the pixel format in Label1. Label1.Text = "Pixel format: " + image1.PixelFormat.ToString() Catch ex As ArgumentException MessageBox.Show("There was an error." _ & "Check the path to the image file.") End Try End Sub
Bitmap image1; private void Button1_Click(System.Object sender, System.EventArgs e) { try { // Retrieve the image. image1 = new Bitmap(@"C:\Documents and Settings\All Users\" + @"Documents\My Music\music.bmp", true); int x, y; // Loop through the images pixels to reset color. for(x=0; x<image1.Width; x++) { for(y=0; y<image1.Height; y++) { Color pixelColor = image1.GetPixel(x, y); Color newColor = Color.FromArgb(pixelColor.R, 0, 0); image1.SetPixel(x, y, newColor); } } // Set the PictureBox to display the image. PictureBox1.Image = image1; // Display the pixel format in Label1. Label1.Text = "Pixel format: "+image1.PixelFormat.ToString(); } catch(ArgumentException) { MessageBox.Show("There was an error." + "Check the path to the image file."); } }
private: Bitmap^ image1; void Button1_Click( System::Object^ /*sender*/, System::EventArgs^ /*e*/ ) { try { // Retrieve the image. image1 = gcnew Bitmap( "C:\\Documents and Settings\\All Users\\" "Documents\\My Music\\music.bmp",true ); int x; int y; // Loop through the images pixels to reset color. for ( x = 0; x < image1->Width; x++ ) { for ( y = 0; y < image1->Height; y++ ) { Color pixelColor = image1->GetPixel( x, y ); Color newColor = Color::FromArgb( pixelColor.R, 0, 0 ); image1->SetPixel( x, y, newColor ); } } // Set the PictureBox to display the image. PictureBox1->Image = image1; // Display the pixel format in Label1. Label1->Text = String::Format( "Pixel format: {0}", image1->PixelFormat ); } catch ( ArgumentException^ ) { MessageBox::Show( "There was an error." "Check the path to the image file." ); } }
private Bitmap image1; private void button1_Click(Object sender, System.EventArgs e) { try { // Retrieve the image. image1 = new Bitmap("C:\\Documents and Settings\\All Users\\" + "Documents\\My Music\\music.bmp", true); int x, y; // Loop through the images pixels to reset color. for (x = 0; x < image1.get_Width(); x++) { for (y = 0; y < image1.get_Height(); y++) { Color pixelColor = image1.GetPixel(x, y); Color newColor = Color.FromArgb(pixelColor.get_R(), 0, 0); image1.SetPixel(x, y, newColor); } } // Set the PictureBox to display the image. pictureBox1.set_Image(image1); // Display the pixel format in label1. label1.set_Text("Pixel format: " + image1.get_PixelFormat().ToString()); } catch (ArgumentException exp) { MessageBox.Show(("There was an error." + "Check the path to the image file.")); } } //button1_Click

- SecurityPermission (アンマネージ コードを呼び出すために必要なアクセス許可)。UnmanagedCode (関連する列挙体)

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Bitmap コンストラクタ (Image, Int32, Int32)
アセンブリ: System.Drawing (system.drawing.dll 内)

Dim original As Image Dim width As Integer Dim height As Integer Dim instance As New Bitmap(original, width, height)


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Bitmap コンストラクタ (Int32, Int32, PixelFormat)
アセンブリ: System.Drawing (system.drawing.dll 内)

Dim width As Integer Dim height As Integer Dim format As PixelFormat Dim instance As New Bitmap(width, height, format)

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Bitmap コンストラクタ (Type, String)
アセンブリ: System.Drawing (system.drawing.dll 内)


このコンストラクタは、特定の型の名前空間をリソースの文字列名と組み合わせて、アセンブリ マニフェスト内で一致を探します。たとえば、Button 型および Button.bmp をこのコンストラクタに渡すと、コンストラクタは System.Windows.Forms.Button.bmp という名前のリソースを探します。

ビットマップを型から作成する方法、および Save メソッドを使用する方法を次のコード例に示します。この例を実行するには、コードを Windows フォームに貼り付けます。フォームの Paint イベントを処理し、ConstructFromResourceSaveAsGif メソッドを呼び出し、e を PaintEventArgs として渡します。
Private Sub ConstructFromResourceSaveAsGif(ByVal e As PaintEventArgs) ' Construct a bitmap from the button image resource. Dim bmp1 As New Bitmap(GetType(Button), "Button.bmp") ' Save the image as a GIF. bmp1.Save("c:\button.gif", System.Drawing.Imaging.ImageFormat.Gif) ' Construct a new image from the GIF file. Dim bmp2 As New Bitmap("c:\button.gif") ' Draw the two images. e.Graphics.DrawImage(bmp1, New Point(10, 10)) e.Graphics.DrawImage(bmp2, New Point(10, 40)) ' Dispose of the image files. bmp1.Dispose() bmp2.Dispose() End Sub
private void ConstructFromResourceSaveAsGif(PaintEventArgs e) { // Construct a bitmap from the button image resource. Bitmap bmp1 = new Bitmap(typeof(Button), "Button.bmp"); // Save the image as a GIF. bmp1.Save("c:\\button.gif", System.Drawing.Imaging.ImageFormat.Gif); // Construct a new image from the GIF file. Bitmap bmp2 = new Bitmap("c:\\button.gif"); // Draw the two images. e.Graphics.DrawImage(bmp1, new Point(10, 10)); e.Graphics.DrawImage(bmp2, new Point(10, 40)); // Dispose of the image files. bmp1.Dispose(); bmp2.Dispose(); }
private: void ConstructFromResourceSaveAsGif(PaintEventArgs^ e) { // Construct a bitmap from the button image resource. Bitmap^ bmp1 = gcnew Bitmap(Button::typeid, "Button.bmp"); String^ savePath = Environment::GetEnvironmentVariable("TEMP") + "\\Button.bmp"; try { // Save the image as a GIF. bmp1->Save(savePath, System::Drawing::Imaging::ImageFormat::Gif); } catch (IOException^) { // Carry on regardless } // Construct a new image from the GIF file. Bitmap^ bmp2 = nullptr; if (File::Exists(savePath)) { bmp2 = gcnew Bitmap(savePath); } // Draw the two images. e->Graphics->DrawImage(bmp1, Point(10, 10)); // If bmp1 did not save to disk, bmp2 may be null if (bmp2 != nullptr) { e->Graphics->DrawImage(bmp2, Point(10, 40)); } // Dispose of the image files. delete bmp1; if (bmp2 != nullptr) { delete bmp2; } }
private void ConstructFromResourceSaveAsGif(PaintEventArgs e) { // Construct a bitmap from the button image resource. Bitmap bmp1 = new Bitmap(Button.class.ToType(), "Button.bmp"); // Save the image as a GIF. bmp1.Save("c:\\button.gif", System.Drawing.Imaging.ImageFormat.get_Gif()); // Construct a new image from the GIF file. Bitmap bmp2 = new Bitmap("c:\\button.gif"); // Draw the two images. e.get_Graphics().DrawImage(bmp1, new Point(10, 10)); e.get_Graphics().DrawImage(bmp2, new Point(10, 40)); // Dispose of the image files. bmp1.Dispose(); bmp2.Dispose(); } //ConstructFromResourceSaveAsGif

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Bitmap コンストラクタ (Int32, Int32)
アセンブリ: System.Drawing (system.drawing.dll 内)




Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Bitmap コンストラクタ (Int32, Int32, Graphics)
アセンブリ: System.Drawing (system.drawing.dll 内)

Dim width As Integer Dim height As Integer Dim g As Graphics Dim instance As New Bitmap(width, height, g)



Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Bitmap コンストラクタ


Bitmap プロパティ

名前 | 説明 | |
---|---|---|
![]() | Flags | この Image のピクセル データに対する属性フラグを取得します。 ( Image から継承されます。) |
![]() | FrameDimensionsList | この Image 内のフレームの大きさを表す GUID の配列を取得します。 ( Image から継承されます。) |
![]() | Height | この Image の高さ (ピクセル単位) を取得します。 ( Image から継承されます。) |
![]() | HorizontalResolution | この Image の水平方向の解像度 (1 インチあたりのピクセル数) を取得します。 ( Image から継承されます。) |
![]() | Palette | この Image に使用するカラー パレットを取得または設定します。 ( Image から継承されます。) |
![]() | PhysicalDimension | このイメージの幅と高さを取得します。 ( Image から継承されます。) |
![]() | PixelFormat | この Image のピクセル形式を取得します。 ( Image から継承されます。) |
![]() | PropertyIdList | この Image に格納されたプロパティ項目の ID を取得します。 ( Image から継承されます。) |
![]() | PropertyItems | この Image に格納されたすべてのプロパティ項目 (メタデータの一部) を取得します。 ( Image から継承されます。) |
![]() | RawFormat | この Image の形式を取得します。 ( Image から継承されます。) |
![]() | Size | このイメージの幅と高さ (ピクセル単位) を取得します。 ( Image から継承されます。) |
![]() | Tag | イメージに関する追加データを提供するオブジェクトを取得または設定します。 ( Image から継承されます。) |
![]() | VerticalResolution | この Image の垂直方向の解像度 (1 インチあたりのピクセル数) を取得します。 ( Image から継承されます。) |
![]() | Width | この Image の幅 (ピクセル単位) を取得します。 ( Image から継承されます。) |

Bitmap メソッド


名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | オーバーロードされます。 ( MarshalByRefObject から継承されます。) |

Bitmap メンバ
グラフィックス イメージのピクセル データとその属性で構成される GDI+ ビットマップをカプセル化します。Bitmap は、ピクセル データで定義したイメージを処理する場合に使用するオブジェクトです。
Bitmap データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | Flags | この Image のピクセル データに対する属性フラグを取得します。(Image から継承されます。) |
![]() | FrameDimensionsList | この Image 内のフレームの大きさを表す GUID の配列を取得します。(Image から継承されます。) |
![]() | Height | この Image の高さ (ピクセル単位) を取得します。(Image から継承されます。) |
![]() | HorizontalResolution | この Image の水平方向の解像度 (1 インチあたりのピクセル数) を取得します。(Image から継承されます。) |
![]() | Palette | この Image に使用するカラー パレットを取得または設定します。(Image から継承されます。) |
![]() | PhysicalDimension | このイメージの幅と高さを取得します。(Image から継承されます。) |
![]() | PixelFormat | この Image のピクセル形式を取得します。(Image から継承されます。) |
![]() | PropertyIdList | この Image に格納されたプロパティ項目の ID を取得します。(Image から継承されます。) |
![]() | PropertyItems | この Image に格納されたすべてのプロパティ項目 (メタデータの一部) を取得します。(Image から継承されます。) |
![]() | RawFormat | この Image の形式を取得します。(Image から継承されます。) |
![]() | Size | このイメージの幅と高さ (ピクセル単位) を取得します。(Image から継承されます。) |
![]() | Tag | イメージに関する追加データを提供するオブジェクトを取得または設定します。(Image から継承されます。) |
![]() | VerticalResolution | この Image の垂直方向の解像度 (1 インチあたりのピクセル数) を取得します。(Image から継承されます。) |
![]() | Width | この Image の幅 (ピクセル単位) を取得します。(Image から継承されます。) |


名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | オーバーロードされます。 ( MarshalByRefObject から継承されます。) |

ビットマップ (情報技術)
ビットマップとは、コンピューティング分野においては特定のドメイン(整数の範囲など)からビットへのマッピングを指し、ビット配列またはビットマップ・インデックスとも呼ばれる。
「ビットマップ」という用語は、名詞として特定のビットマップアプリケーションを指すためによく使用される。pix-mapは、ピクセルのマップを指し、各ピクセルが2色以上を格納することができ、したがって、ピクセルあたり1ビット以上を使用するピクセルのマップを指す。この場合、デジタルグラフィック出力装置(スクリーンまたはモニター)を構成するピクセルの配列が問題となる。ビットマップは1画素あたり1ビットを意味し、ピクセルマップは1画素あたり複数ビットの画像に使用されることがある[1][2]。
ビットマップは、デジタル画像を保存するために使用されるメモリ構成または画像ファイル形式の一種である。ビットマップという用語は、コンピュータのプログラミング用語に由来し、単なるビットのマップ、空間的にマッピングされたビットの配列という意味である。現在では、pixmapとともに、一般に、空間的にマッピングされたピクセルの配列という同様の概念を指す。ラスター画像は一般にビットマップまたはピクセルマップと呼ばれることがあり、合成画像か写真か、ファイルかメモリかにかかわらず、ビットマップまたはピクセルマップと呼ばれることがある。
多くのグラフィカルユーザーインターフェイスは、組み込みのグラフィックサブシステムでビットマップを使用する[3]。たとえば、 Microsoft WindowsおよびOS / 2プラットフォームで使用されるGDIサブシステムでは、使用される特定の形式はWindowsおよびOS / 2ビットマップファイル形式であり、通常はファイル拡張子にBMP
(または.
デバイスに依存しないビットマップのDIB )の名前が付けられる。 BMPの他に、リテラルビットマップを格納する他のファイル形式には、 InterLeaved Bitmap(ILBM) 、 Portable Bitmap(PBM) 、 X Bitmap(XBM) 、およびWireless Application Protocol Bitmap(WBMP)が含まれる。同様に、JPEG 、 TIFF 、 PNG 、 GIFなど、他のほとんどの画像ファイル形式も(ベクターグラフィックではなく)ビットマップ画像を保存するが、内部で圧縮形式を使用するため、通常はビットマップとは呼ばれない。
ピクセル ストレージ
一般的な非圧縮ビットマップでは、画像ピクセルは通常、その色深度を識別する可変ビット数のピクセルごとに格納される。 8ビット以下のピクセルは、グレースケールまたはインデックスカラーのいずれかを表すことができる。アルファチャネル(透明度用)は、グレースケールビットマップに似た別のビットマップ、またはたとえば24ビット画像をピクセルあたり32ビットに変換する4番目のチャネルに格納できる。
ビットマップピクセルを表すビットは、フォーマットまたはデバイスの要件に応じて、パックまたはアンパック(バイトまたはワードの境界に間隔を空けて)することができる。色深度に応じて、画像のピクセルは少なくともn / 8バイトを占有し、nはビット深度である。
圧縮されていない、行内にパックされている、Microsoft DIBまたはBMPファイル形式、または非圧縮TIFF形式で保存されているビットビットの場合、nビット/ピクセル(2 n色)ビットマップのストレージサイズの下限。バイト単位で、次のように計算できる。
- サイズ=幅•高さ•n / 8、ここで高さと幅はピクセル単位で示される。
上記の式には、ヘッダーサイズとカラーパレットサイズは含まれていません。各行の開始をワードなどのストレージユニットの境界に揃えるための行パディングの影響により、追加のバイトが必要になる場合がある。
デバイスに依存しないビットマップとBMPファイル形式
Microsoftは、さまざまな内部表現を使用してデバイスとアプリケーション間でビットマップを交換するための支援として、さまざまな色深度のカラービットマップの特定の表現を定義している。彼らはこれらのデバイスに依存しないビットマップをDIBと呼び、それらのファイル形式はDIBファイル形式またはBMPファイル形式と呼ばれる。 Microsoftのサポートによると[4]:
デバイスに依存しないビットマップ(DIB)は、さまざまな色深度でデバイスに依存しないビットマップを定義するために使用される形式です。 DIBの主な目的は、ビットマップをあるデバイスから別のデバイスに移動できるようにすることです(したがって、名前のデバイスに依存しない部分)。 DIBは、(アプリケーションによって作成された)ビットマップオブジェクトとしてシステムに表示されるデバイス依存のビットマップとは対照的に、外部フォーマットです.....)。 DIBは通常、メタファイル(通常、StretchDIBits()関数を使用)、BMPファイル、およびクリップボード(CF_DIBデータ形式)で転送されます。
ここで、「デバイスに依存しない」とは、フォーマットまたはストレージの配置を指し、デバイスに依存しない色と混同しないでください。
その他のビットマップファイル形式
X Window Systemは、白黒画像に同様のXBM形式を使用し、カラー画像にXPM (ピクセルマップ)を使用する。他にも多くの非圧縮ビットマップファイル形式が使用されているが、ほとんどの場合広くは使用されていない[5]。ほとんどの目的では、GIF 、 PNG 、 TIFF 、 JPEGなどの標準化された圧縮ビットマップファイルが使用される。特にロスレス圧縮は、より小さなファイルサイズのビットマップと同じ情報を提供する[6] 。TIFFとJPEGにはさまざまなオプションがある。 JPEGは通常、不可逆圧縮で、TIFFは通常、圧縮されていないか、 GIFのようにロスレスのLempel–Ziv–Welch圧縮されている。 PNGは、別のLempel-Zivバリアントであるデフレートロスレス圧縮を使用する。
他の情報なしで生のビットマップを保存するさまざまな「生の」画像ファイルもある。このようなrawファイルは、ファイル内の単なるビットマップであり、多くの場合、ヘッダーやサイズの情報はない(TIFF形式などの構造化されたコンテナーに未処理のセンサーデータを広範な画像メタデータとともに保存する写真のraw画像形式とは異なる)。
脚注
- ^ James D. Foley (1995). Computer Graphics: Principles and Practice. Addison-Wesley Professional. pp. 13. ISBN 0-201-84840-6 . "The term bitmap, strictly speaking, applies only to 1-bit-per-pixel bilevel systems; for multiple-bit-per-pixel systems, we use the more general term pix-map (short for pixel map)."
- ^ V.K. Pachghare (2005). Comprehensive Computer Graphics: Including C++. Laxmi Publications. pp. 93. ISBN 81-7008-185-8
- ^ Julian Smart; Stefan Csomor; Kevin Hock (2006). Cross-Platform GUI Programming with Wxwidgets. Prentice Hall. ISBN 0-13-147381-6
- ^ “Device-Independent Bitmaps”. Windows App Development (2021年1月8日). 2022年9月5日閲覧。
- ^ “List of bitmap file types”. Search File-Extensions.org. 2022年9月5日閲覧。
- ^ J. Thomas; A. Jones (2006). Communicating Science Effectively: a practical handbook for integrating visual elements. IWA Publishing. ISBN 1-84339-125-2
参照
- 空き領域ビットマップ、使用中のディスクストレージブロックを追跡するビットの配列
- ラスターグラフィックス
- ラスタースキャン
- ラスタライズ
- スプライト(コンピューターグラフィックス)
- タイルマップ
- ボクセル
- ベクターグラフィックス
- bitmapのページへのリンク