PeachImage
PeachImage.Formats.Png
PngColorMode Enum
Controls whether PngEncoderOptions encodes an indexed (PLTE) palette. Only ever affects Rgb24/Rgba32 sources — grayscale and 16-bit-per-channel sources always encode via their existing color type.
public enum PngColorMode
Fields
Auto 0
Indexed color (PLTE) when the source has at most MaxColors distinct opaque colors and its alpha channel, if any, is strictly binary (every pixel fully opaque or fully transparent) — the only case indexed color can represent losslessly. Otherwise falls back to grayscale/truecolor, so this mode never discards image data.
Indexed 1
Always indexed color (PLTE), quantizing down to MaxColors entries via median-cut if the source has more distinct colors than that, and collapsing any partial alpha to fully opaque/transparent at the same 128 threshold GIF encoding uses. Both are lossy when they apply — an explicit trade of fidelity for a smaller file, mirroring GifEncoderOptions.
Truecolor 2
Always grayscale/truecolor — the only behavior available before indexed-color encoding existed.