KnownPixelFormat Enumeration

Represents pixel formats with built-in support. For custom formats you can use the PixelFormatInfo type when applicable.

Definition

Namespace: KGySoft.Drawing.Imaging
Assembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 8.0.0-preview.1
C#
public enum KnownPixelFormat

Remarks

  Note

The KnownPixelFormat enumeration contains all formats that the System.Drawing.Imaging.PixelFormat enumeration also has, though some fields have different values and the matching names do not necessarily represent the same pixel layout either. For example, in this library wide formats, such as Format64bppArgb, use the full 16 bit per color channel range and the same gamma correction as the 8-bit per channel formats, whereas System.Drawing.Imaging.PixelFormat.Format64bppArgb might represent a different range or gamma correction, depending on the operating system.

Members

Undefined0 The pixel format is undefined.
Format16bppRgb555135,173

Represents a 16 bit per pixel RGB color format where red, green and blue channels use 5 bits per pixel and 1 bit is unused.

Bit order from LSB to MSB: 5 blue, 5 green, 5 red bits and 1 unused bit. As a binary value a pixel can be specified as 0b_X_RRRRR_GGGGG_BBBBB on little endian CPUs where X is the ignored most significant bit and BBBBB is the blue component at the least significant bits.

The closest color type that can represent this pixel format without losing information is Color32.

Format16bppRgb565135,174

Represents a 16 bit per pixel RGB color format where red, green and blue channels use 5, 6 and 5 bits per pixel, respectively.

Bit order from LSB to MSB: 5 blue, 6 green and 5 red bits. As a binary value a pixel can be specified as 0b_RRRRR_GGGGGG_BBBBB on little endian CPUs where BBBBB is the blue component at the least significant bits.

The closest color type that can represent this pixel format without losing information is Color32.

Format24bppRgb137,224

Represents a 24 bit per pixel RGB color format where red, green and blue channels use 8 bits per pixel.

Bit order from LSB to MSB: 8 blue, 8 green and 8 red bits.

The closest color type that can represent this pixel format without losing information is Color32.

Format32bppRgb139,273

Represents a 32 bit per pixel RGB color format where red, green and blue channels use 8 bits per pixel. The remaining 8 bits are not used.

Bit order from LSB to MSB: 8 blue, 8 green, 8 red and 8 unused bits. As a hex value a pixel can be specified as 0x_XX_RR_GG_BB on little endian CPUs where XX is the unused most significant byte and BB is the blue component at the least significant byte.

The closest color type that can represent this pixel format without losing information is Color32.

Format1bppIndexed196,865

Represents the indexed 1 bit per pixel format. The corresponding color palette can have up to 2 colors.

Bit order: bits are filled up from the most significant bit to the least significant bit within a byte.

Indexed pixel formats are represented by the Palette type where every palette entry is a Color32.

Format4bppIndexed197,634

Represents the indexed 4 bit per pixel format. The corresponding color palette can have up to 16 colors.

Bit order: even pixels occupy the high bits of a byte, whereas odd pixels are in the low bits.

Indexed pixel formats are represented by the Palette type where every palette entry is a Color32.

Format8bppIndexed198,659

Represents the indexed 8 bit per pixel format. The corresponding color palette can have up to 256 colors.

Indexed pixel formats are represented by the Palette type where every palette entry is a Color32.

Format32bppPArgb925,707

Represents a 32 bit per pixel ARGB color format where alpha, red, green and blue channels use 8 bits per pixel. The red, green, and blue components are premultiplied, according to the alpha component.

Bit order from LSB to MSB: 8 blue, 8 green, 8 red and 8 alpha bits. As a hex value a pixel can be specified as 0x_AA_RR_GG_BB on little endian CPUs where BB is the blue component at the least significant byte.

The matching color type that represents this pixel format directly is PColor32.

Format48bppRgb1,060,876

Represents a 48 bit per pixel RGB color format where red, green and blue channels use 16 bits per pixel.

Bit order from LSB to MSB: 16 blue, 16 green and 16 red bits.

The closest color type that can represent this pixel format without losing information is Color64.

Format64bppPArgb1,851,406

Represents a 64 bit per pixel ARGB color format where alpha, red, green and blue channels use 16 bits per pixel. The red, green, and blue components are premultiplied, according to the alpha component.

Bit order from LSB to MSB: 16 blue, 16 green, 16 red and 16 alpha bits. As a hex value a pixel can be specified as 0x_AAAA_RRRR_GGGG_BBBB on little endian CPUs where BBBB is the blue component at the least significant couple of bytes.

The matching color type that represents this pixel format directly is PColor64.

Format32bppArgb2,498,570

Represents a 32 bit per pixel ARGB color format where alpha, red, green and blue channels use 8 bits per pixel.

Bit order from LSB to MSB: 8 blue, 8 green, 8 red and 8 alpha bits. As a hex value a pixel can be specified as 0x_AA_RR_GG_BB on little endian CPUs where BB is the blue component at the least significant byte.

The matching color type that represents this pixel format directly is Color32.

Format64bppArgb3,424,269

Represents a 64 bit per pixel ARGB color format where alpha, red, green and blue channels use 16 bits per pixel.

Bit order from LSB to MSB: 16 blue, 16 green, 16 red and 16 alpha bits. As a hex value a pixel can be specified as 0x_AAAA_RRRR_GGGG_BBBB on little endian CPUs where BBBB is the blue component at the least significant couple of bytes.

The matching color type that represents this pixel format directly is Color64.

Format8bppGrayScale33,556,499

Represents a 8 bit per pixel grayscale format. The color information specifies 256 shades of gray.

The closest color type that can represent this pixel format without losing information is Color32.

Format16bppGrayScale34,607,108

Represents a 16 bit per pixel grayscale format. The color information specifies 65536 shades of gray.

The closest color type that can represent this pixel format without losing information is Color64.

Format16bppArgb155567,506,183

Represents a 16 bit per pixel ARGB color format where red, green and blue channels use 5 bits per pixel along with 1 bit for alpha.

Bit order from LSB to MSB: 5 blue, 5 green, 5 red bits and 1 alpha bit. As a binary value a pixel can be specified as 0b_A_RRRRR_GGGGG_BBBBB on little endian CPUs where A is the most significant bit and BBBBB is the blue component at the least significant bits.

The closest color type that can represent this pixel format without losing information is Color32.

Format96bppRgb402,677,776

Represents a 96 bit per pixel RGB color format where red, green and blue channels use 32 bits per pixel.

Bit order from LSB to MSB: 32 red, 32 green and 32 blue bits. The color components are floating point values between 0 and 1 in the linear color space.

The closest color type that can represent this pixel format without losing information is ColorF.

Format128bppRgba402,948,113

Represents a 128 bit per pixel ARGB color format where alpha, red, green and blue channels use 32 bits per pixel.

Bit order from LSB to MSB: 32 red, 32 green, 32 blue and 32 alpha bits. The color components are floating point values between 0 and 1 in the linear color space.

The matching color type that represents this pixel format directly is ColorF.

Format128bppPRgba403,472,402

Represents a 128 bit per pixel ARGB color format where alpha, red, green and blue channels use 32 bits per pixel. The red, green, and blue components are premultiplied, according to the alpha component.

Bit order from LSB to MSB: 32 red, 32 green, 32 blue and 32 alpha bits. The color components are floating point values between 0 and 1 in the linear color space.

The matching color type that represents this pixel format directly is PColorF.

Format32bppGrayScale436,215,828

Represents a 32 bit per pixel grayscale format. The color information specifies about one billion shades of gray between 0 and 1 where the largest difference between two representable values is about 0.00000001 (10-8).

The closest color type that can represent this pixel format without losing information is ColorF.

See Also