Enum PngChunkPosition
Where a kept chunk sat in the file, so it can be written back in the same place.
public enum PngChunkPosition
Fields
AfterImageData = 2After the last IDAT, before IEND.
BeforeImageData = 1After PLTE (if any), before the first IDAT.
BeforePalette = 0After 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,
});