function pngFile
pngFile(): Coder<>

Creates a coder for complete PNG files with automatic chunk refinement.

This is the main entry point for working with PNG files. It creates a coder that handles the PNG signature and automatically refines known chunk types (IHDR, PLTE, tRNS, bKGD, IDAT, IEND) to their structured representations.

Examples

Decode a PNG file

import { assert } from "@std/assert";
import { pngFile } from "@binstruct/png";

const coder = pngFile();

// The coder can encode and decode complete PNG files
assert(typeof coder.decode === "function");
assert(typeof coder.encode === "function");

Return Type

A coder for complete PNG files with refined chunk types.

Usage

import { pngFile } from ".";