Table of Contents

Enum PngChunkPosition

Namespace
Egami.Formats.Png
Assembly
Egami.dll

Where a kept chunk sat in the file, so it can be written back in the same place.

public enum PngChunkPosition

Fields

AfterImageData = 2

After the last IDAT, before IEND.

BeforeImageData = 1

After PLTE (if any), before the first IDAT.

BeforePalette = 0

After IHDR, before PLTE.

Examples

// Force a palette, choose a filter and a zlib strategy, and keep a private chunk.
((PngDetails)image.Metadata.FormatDetails!).OtherChunks.Add(
    new PngChunk("prVt", "hello"u8.ToArray(), PngChunkPosition.AfterImageData));
image.Save("duck-palette.png", new PngWriterOptions
{
    ColorType = PngColorType.Palette,
    Filter = PngFilterMode.Paeth,
    CompressionStrategy = PngCompressionStrategy.Filtered,
});