Table of Contents

Enum BmpPixelFormat

Namespace
Egami.Formats.Bmp
Assembly
Egami.dll

The pixel layout a BMP is written with.

public enum BmpPixelFormat

Fields

Auto = 0

24-bit when every pixel is opaque, else 32-bit with alpha.

Bgr24 = 5

24-bit blue, green and red. Alpha is dropped, not blended onto a background.

Bgr555 = 7

16-bit 5-5-5 blue, green and red, the default 16-bit layout every reader opens. Alpha is dropped.

Bgr565 = 8

16-bit 5-6-5 blue, green and red, with a V4 header and bit-field masks. Alpha is dropped.

Bgra32 = 6

32-bit blue, green, red and alpha, with a V4 header and bit-field masks.

Bgra5551 = 9

16-bit 5-5-5 blue, green and red and a 1-bit alpha, with a V4 header and bit-field masks.

Indexed1 = 1

A 2-color palette.

Indexed2 = 2

A 4-color palette, a Windows CE layout many desktop readers cannot open.

Indexed4 = 3

A palette of up to 16 colors.

Indexed8 = 4

A palette of up to 256 colors.

Examples

// Auto (the default): 24-bit when every pixel is opaque, 32-bit with alpha otherwise.
image.Save("duck.bmp");

// A 16-color palette, built from the image and dithered.
image.Save("duck-16.bmp", new BmpWriterOptions { PixelFormat = BmpPixelFormat.Indexed4 });

// The same palette, run-length encoded (RLE4): smaller where the image has flat areas.
image.Save("duck-16-rle.bmp", new BmpWriterOptions { PixelFormat = BmpPixelFormat.Indexed4, RunLength = true });