Table of Contents

Enum PnmKind

Namespace
Egami.Formats.Pnm
Assembly
Egami.dll

Which Netpbm variant a file is, or which one to write.

public enum PnmKind

Fields

Auto = 0

When writing: PFM for float types without alpha, PGM for other gray types, PPM for other types without alpha, PAM for types with alpha.

Bitmap = 1

PBM (P1 or P4): one bit a pixel, 1 for black.

FloatMap = 5

PFM (PF or Pf): 32-bit float RGB or gray in linear light, loaded as RgbF32 or GrayF32. Gray pixel types are written as Pf, the rest as PF; alpha is dropped.

Graymap = 2

PGM (P2 or P5): gray.

Pam = 4

PAM (P7): gray, RGB, or either with alpha.

Pixmap = 3

PPM (P3 or P6): RGB.

Examples

// Auto: P5 (PGM) for gray, P6 (PPM) for color, P7 (PAM) when the pixel type has alpha.
image.Save("duck.ppm");

// The plain-text forms, for tools that read them; lines are at most 70 characters.
image.Save("duck-plain.ppm", new PnmWriterOptions { PlainText = true });

// A 1-bit bitmap, thresholded at 50% gray.
image.Save("duck.pbm", new PnmWriterOptions { Kind = PnmKind.Bitmap });