Web Analytics Made Easy -
StatCounter

PNG

Abstract

This document describes PNG (Portable Network Graphics), an extensible file format for the lossless, portable, well-compressed storage of raster images. PNG provides a patent-free replacement for GIF and can also replace many common uses of TIFF. Indexed-color, grayscale, and truecolor images are supported, plus an optional alpha channel. Sample depths range from 1 to 16 bits.

PNG is designed to work well in online viewing applications, such as the World Wide Web, so it is fully streamable with a progressive display option. PNG is robust, providing both full file integrity checking and simple detection of common transmission errors. Also, PNG can store gamma and chromaticity data for improved color matching on heterogeneous platforms.

This specification defines a proposed Internet Media Type image/png.

Introduction

The PNG format provides a portable, legally unencumbered, well-compressed, well-specified standard for lossless bitmapped image files.

Although the initial motivation for developing PNG was to replace GIF, the design provides some useful new features not available in GIF, with minimal cost to developers.

GIF features retained in PNG include:

  • Indexed-color images of up to 256 colors.
  • Streamability: files can be read and written serially, thus allowing the file format to be used as a communications protocol for on-the-fly generation and display of images.
  • Progressive display: a suitably prepared image file can be displayed as it is received over a communications link, yielding a low-resolution image very quickly followed by gradual improvement of detail.
  • Transparency: portions of the image can be marked as transparent, creating the effect of a non-rectangular image.
  • Ancillary information: textual comments and other data can be stored within the image file.
  • Complete hardware and platform independence.
  • Effective, 100% lossless compression.

Important new features of PNG, not available in GIF, include:

  • Truecolor images of up to 48 bits per pixel.
  • Grayscale images of up to 16 bits per pixel.
  • Full alpha channel (general transparency masks).
  • Image gamma information, which supports automatic display of images with correct brightness/contrast regardless of the machines used to originate and display the image.
  • Reliable, straightforward detection of file corruption.
  • Faster initial presentation in progressive display mode.

PNG is designed to be:

  • Simple and portable: developers should be able to implement PNG easily.
  • Legally unencumbered: to the best knowledge of the PNG authors, no algorithms under legal challenge are used. (Some considerable effort has been spent to verify this.)
  • Well compressed: both indexed-color and truecolor images are compressed as effectively as in any other widely used lossless format, and in most cases more effectively.
  • Interchangeable: any standard-conforming PNG decoder must read all conforming PNG files.
  • Flexible: the format allows for future extensions and private add-ons, without compromising interchangeability of basic PNG.
  • Robust: the design supports full file integrity checking as well as simple, quick detection of common transmission errors.

The main part of this specification gives the definition of the file format and recommendations for encoder and decoder behavior. An appendix gives the rationale for many design decisions. Although the rationale is not part of the formal specification, reading it can help implementors understand the design. Cross-references in the main text point to relevant parts of the rationale. Additional appendixes, also not part of the formal specification, provide tutorials on gamma and color theory as well as other supporting material.

In this specification, the word "must" indicates a mandatory requirement, while "should" indicates recommended behavior.

Authors

Authors' names are presented in alphabetical order.

  • Mark Adler, madler@alumni.caltech.edu
  • Thomas Boutell, boutell@boutell.com
  • Christian Brunschen, cb@df.lth.se
  • Adam M. Costello, amc@cs.berkeley.edu
  • Lee Daniel Crocker, lee@piclab.com
  • Andreas Dilger, adilger@enel.ucalgary.ca
  • Oliver Fromme, fromme@rz.tu-clausthal.de
  • Jean-loup Gailly, gzip@prep.ai.mit.edu
  • Chris Herborth, chrish@qnx.com
  • Alex Jakulin, Aleks.Jakulin@snet.fri.uni-lj.si
  • Neal Kettler, kettler@cs.colostate.edu
  • Tom Lane, tgl@sss.pgh.pa.us
  • Alexander Lehmann, alex@hal.rhein-main.de
  • Chris Lilley, chris@w3.org
  • Dave Martindale, davem@cs.ubc.ca
  • Owen Mortensen, 104707.650@compuserve.com
  • Keith S. Pickens, ksp@swri.edu
  • Robert P. Poole, lionboy@primenet.com
  • Glenn Randers-Pehrson, glennrp@arl.mil or randeg@alumni.rpi.edu
  • Greg Roelofs, newt@pobox.com
  • Willem van Schaik, willem@gintic.gov.sg
  • Guy Schalnat
  • Paul Schmidt, pschmidt@photodex.com
  • Tim Wegner, 71320.675@compuserve.com
  • Jeremy Wohl, jeremyw@anders.com

official specification w3.org/TR/REC-png-96100