PNG File Format - Portable Network Graphics

  1. What does PNG stand for and when was it created?
    PNG stands for "Portable Network Graphics." It was initially released on October 1, 1996, as a W3C Recommendation, and later published as RFC 2083 in January 1997. The format was developed by the PNG Development Group led by Thomas Boutell as a patent-free replacement for GIF.
  2. What type of compression does PNG use?
    PNG uses lossless data compression. Specifically, it employs:
    • Deflate compression algorithm (LZ77-based)
    • A sliding window of at most 32,768 bytes
    • Adaptive filtering with five filter types (None, Sub, Up, Average, Paeth) applied before compression to improve compressibility
  3. What color types and bit depths does PNG support?
    PNG supports five image types with sample depths ranging from 1 to 16 bits:
    • Greyscale (color type 0)
    • Truecolor RGB (color type 2)
    • Indexed-color with palette (color type 3)
    • Greyscale with alpha channel (color type 4)
    • Truecolor RGB with alpha channel (color type 6)
  4. What is the structure of a PNG file?
    A PNG file consists of an 8-byte signature (89 50 4E 47 0D 0A 1A 0A) followed by a series of chunks. Each chunk contains a length field, chunk type (4 bytes), chunk data, and a CRC-32 checksum. Critical chunks include IHDR (image header), PLTE (palette), IDAT (image data), and IEND (image trailer).
  5. What are some key features that distinguish PNG from GIF?
    PNG was designed as a superior replacement for GIF and includes several important features not available in GIF:
    • Truecolor images up to 48 bits per pixel (vs. GIF's 256 colors)
    • Full alpha channel for variable transparency (vs. GIF's binary transparency)
    • Grayscale images up to 16 bits per pixel
    • Gamma correction information for consistent color display across platforms
    • Better compression for most image types
    • No patent restrictions (GIF used LZW compression which was patented)
PNG Transparency Demonstration - Four colored dice with transparency channel over checkered background