Table of Contents

Class PnmWriterOptions

Namespace
Egami.Formats.Pnm
Assembly
Egami.dll

Options for writing PBM, PGM, PPM or PAM.

public sealed class PnmWriterOptions : WriterOptions
Inheritance
PnmWriterOptions
Inherited Members

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 });

Properties

Default

Gets the default options.

public static PnmWriterOptions Default { get; }

Property Value

PnmWriterOptions

Kind

Gets the variant to write. Defaults to Auto. Bitmap thresholds pixels at 50% gray, Graymap converts to gray and Pixmap drops alpha.

public PnmKind Kind { get; init; }

Property Value

PnmKind

PlainText

Gets whether to write samples as text (P1, P2 or P3) in lines of at most 70 characters. Defaults to false. PAM has no text form, so it is always binary.

public bool PlainText { get; init; }

Property Value

bool