private void WriteImageHeader() { using (var chunk = new PngChunkStream(output, PngChunkIdentifier.ImageHeader)) { var colorType = palette.Count > 0 ? PngColorType.IndexedColour : PngColorType.TruecolourWithAlpha; chunk.WriteBigEndian(Width); chunk.WriteBigEndian(Height); chunk.WriteByte(8); // Bit depth chunk.WriteByte(colorType); chunk.WriteByte(0); // Compression chunk.WriteByte(0); // Filter chunk.WriteByte(0); // Interlace } }
private void WriteImageGamma() { using (var chunk = new PngChunkStream(output, PngChunkIdentifier.ImageGamma)) { chunk.WriteBigEndian(45455); } }