PNG & CSS power at Youngpup.net

In Engineering, History, Image by Fredy Ore

I revisit Youngpup.net looking for some use of Styles and I came across some interesting articles on PNG.

PNG stands for Portable Network Graphics and is an extensible file format for lossless, portable, well-compressed raster images. PNG is a patents free replacement to GIF. It has an optional alpha channel for transparency and its sample depths range from 1 to 16 bits per component (up to 48bit images for RGB, or 64bit for RGBA).

On a more historical point, PNG began in New Year’s Day 1995 when Unisys and CompuServe suddenly announced that programs implementing GIF would require royalties, because of Unisys’ patent on the LZW compression method used in GIF.

youngpup.net for a historical walkthrough of the PNG format visit Greg Roelofs The Story of PNG.

Reference:

Portable Network Graphics (PNG): A Technical Overview

Source: Roelofs, Greg. “The Story of PNG.” 25 February 1999.

Overview
The Portable Network Graphics (PNG) format, developed as an open, patent-free alternative to GIF, has established itself as a robust image format with significant adoption in non-web applications since its introduction in 1996. While it has not fully dominated web usage, PNG has become a standard component in image processing software, where its absence is considered a deficiency by industry standards and consumers. Native support in major web browsers, Netscape Navigator (version 4.04) and Microsoft Internet Explorer (version 4.0), began in autumn 1997, though incomplete implementation of advanced features like alpha transparency and gamma correction has slowed web adoption.

Technical Capabilities
PNG supports a wide range of image types and features, designed to address limitations of earlier formats like GIF and JPEG:

  • Color Models:
  • Palette-based images (1, 2, 4, 8-bit, up to 256 colors), akin to GIF.
  • Grayscale images (1, 2, 4, 8, 16-bit, supporting 2 to 65,536 shades).
  • Truecolor images (24-bit RGB, 48-bit with 16 bits per channel), comparable to TIFF.
  • Transparency:
  • Binary transparency (single fully transparent color), supported across palette, grayscale, and RGB modes, unlike GIF’s palette-only restriction.
  • Alpha transparency (8-bit or 16-bit alpha channel, offering 256 or 65,536 levels of partial transparency), similar to TIFF.
  • Alpha-palette transparency (RGBA palette entries), a unique feature shared only with Targa/TGA, enabling per-pixel transparency in indexed-color images.
  • Gamma and Color Correction: Direct support for gamma correction ensures consistent brightness and color across platforms (e.g., preventing images from appearing too dark on PCs or too light on Macs). Chromaticity data (e.g., sRGB or custom ICC profiles) enhances color accuracy.
  • Compression: Utilizes lossless DEFLATE compression (zlib), free of patent encumbrances, unlike GIF’s LZW. PNG employs adaptive filtering (five filter types: none, sub, up, average, Paeth) to optimize compression based on pixel prediction, improving efficiency for various image types.
  • Interlacing: Implements a two-dimensional Adam7 interlacing scheme, enabling progressive display with seven passes, offering a more refined progression than JPEG’s one-dimensional approach.
  • Extensibility: PNG’s chunk-based structure allows backward and forward compatibility, with critical chunks (e.g., IHDR, IDAT) required for decoding and ancillary chunks (e.g., gAMA, tRNS) for optional metadata like timestamps or text annotations.
  • No Animation: Animation is supported by the related Multiple-image Network Graphics (MNG) format, not PNG itself.

File Size Considerations
PNG’s lossless compression results in larger file sizes for truecolor images compared to lossy JPEG, particularly for 24-bit or 48-bit images. However, for palette-based images, PNG achieves competitive sizes with GIF while offering superior features like alpha transparency and gamma correction. For example, an 8-bit RGBA-palette PNG with alpha transparency can match the file size of a binary-transparency GIF while providing smoother anti-aliasing and drop-shadow effects against varied backgrounds.

Standardization and Documentation
PNG’s longevity is supported by its formal recognition:

  • Published as an informational RFC (2083) in January 1997.
  • Designated as the first W3C Recommendation in October 1996.
  • Undergoing joint ISO/IEC standardization (ISO/IEC 15948), ensuring global acceptance.
    The format is extensively documented in PNG: The Definitive Guide (O’Reilly, 1999), a 350-page resource covering technical specifications, implementation strategies, and three demonstration programs with freely downloadable source code under a BSD-like license. Additional resources are available on the PNG home site, which catalogs supporting applications, and through technical mailing lists.

Implementation and Browser Support
PNG’s advanced features, such as 32-bit RGBA (8 bits per red, green, blue, and alpha channel) and RGBA-palette images, push beyond the capabilities of most contemporaneous formats, posing implementation challenges. As of 1999:

  • Browsers: Microsoft Internet Explorer 4.0 supports gamma correction, with version 5.0 for Mac planned to include full alpha transparency. Netscape Navigator 5.0 (Mozilla) aims for comprehensive alpha and gamma support, with ongoing development led by the format’s proponent. WebTV’s browser handles 32-bit RGBA effectively but struggles with palette-based PNGs.
  • Applications: The GIMP excels in compression and 32-bit RGBA support, with gamma correction improvements slated for post-1.0.2 releases. Fireworks 2.0 offers robust RGBA-palette support. Many applications lag in fully implementing alpha transparency and advanced filtering due to their complexity.

Development Efforts
To address adoption barriers, a planned 32-bit to 8-bit converter aims to reduce RGBA image sizes by a factor of four with minimal visual loss, comparable to high-quality RGB-to-palette dithering. PNG’s reference libraries (e.g., libpng, zlib) are open-source, non-GPL, and freely available, facilitating integration into software without licensing concerns. These libraries include optimized implementations of DEFLATE and filtering algorithms, supporting developers in achieving high compression ratios.

Competition and Market Position
PNG faces competition from emerging formats like SVG (vector-based) and JPEG2000/JPEG-LS (advanced lossy/lossless compression). Historical proprietary formats (e.g., AOL’s ART, Iterated Systems’ FIF) have failed to gain traction due to the web’s preference for open standards. Even JPEG’s arithmetic coding, offering 5-10% better compression than standard DCT-Huffman, remains underutilized. PNG’s open-standard status, combined with its feature set, positions it favorably, though widespread web adoption hinges on improved browser support, potentially requiring collaboration between Netscape and Microsoft.

Conclusion
PNG’s technical sophistication, including its support for diverse color models, advanced transparency, and lossless compression, has solidified its role in image processing applications. While web adoption remains incomplete due to browser limitations, ongoing standardization, robust documentation, and active development ensure PNG’s relevance. Developers and users can access extensive resources via the PNG home site and related mailing lists to leverage its capabilities fully.