What is PNG?

PNG (Portable Network Graphics) is a raster graphics file format that supports lossless data compression and transparency. It was created as an improved, non-patented replacement for GIF and is widely used for web graphics.

Quick Facts

Full NamePortable Network Graphics
Created1996 by PNG Development Group
SpecificationOfficial Specification

How PNG Works

PNG was developed in 1996 as a response to patent issues with the GIF format. It uses DEFLATE compression to reduce file size without losing image quality. PNG supports various color depths including 24-bit RGB and 32-bit RGBA (with alpha channel for transparency). Unlike JPEG, PNG is ideal for images with sharp edges, text, and graphics that require transparency. The format supports interlacing for progressive display and includes gamma correction for cross-platform color consistency.

Key Characteristics

  • Lossless compression - no quality degradation
  • Supports alpha channel transparency (32-bit RGBA)
  • Better for graphics, text, and sharp edges than JPEG
  • Larger file size than JPEG for photographs
  • Supports interlacing for progressive loading
  • No animation support (unlike GIF)

Common Use Cases

  1. Website graphics with transparency
  2. Screenshots and screen captures
  3. Logos and icons with transparent backgrounds
  4. Graphics with text and sharp edges
  5. Images requiring lossless quality

Example

PNG File Structure:

┌─────────────────────────────────┐
│ PNG Signature (8 bytes)         │
│ 89 50 4E 47 0D 0A 1A 0A        │
├─────────────────────────────────┤
│ IHDR Chunk (Image Header)       │
│ - Width, Height                 │
│ - Bit depth, Color type         │
├─────────────────────────────────┤
│ IDAT Chunks (Image Data)        │
│ - Compressed pixel data         │
├─────────────────────────────────┤
│ IEND Chunk (Image End)          │
└─────────────────────────────────┘

Color Types:
0 = Grayscale
2 = RGB (Truecolor)
3 = Indexed (Palette)
4 = Grayscale + Alpha
6 = RGBA (Truecolor + Alpha)

Related Tools on QubitTool

Related Concepts