The PNG format (Portable Network Graphics or Ping format) is a bitmap (raster) graphic file format. It was developed in 1995 in order to provide a free alternative to the GIF format, which is a proprietary format whose rights are held by Unisys (proprietor of the LZW compression algorithm), to whom all software publishers using this type of format are under obligation to pay royalties. Thus, PNG is also a recursive acronym for PNG Not GIF.
The PNG format makes it possible to store images in black and white (a color depth of 16 bits per pixel), true color (a color depth of 48 bits per pixel), as well as indexed images, using a palette of 256 colors.
Moreover, it supports alpha channel transparency, i.e. the possibility of defining 256 levels of transparency, while the GIF format only allows one color of the pallet to be defined as transparent. It also has an interlacing function which makes it possible to show the image gradually.
The compression offered by this format is a (lossless compression) 5 to 25% better than GIF compression.
Finally, PNG stores image gamma information, which makes a gamma correction possible and allows it to become display-device-independent. Error correction mechanisms are also stored in the file in order to guarantee its integrity.
A PNG file comprises a signature, making it possible to indicate that it is a PNG file, followed by a series of elements called chunks. The signature of a PNG file (in decimal notation) is the following:
137 80 78 71 13 10 26 10The same signature in hexadecimal notation is:
89 50 4E 47 0D 0A 1A 0A
Each chunk comprises 4 parts :
The chunks can be present in any order except that they must start with the header chunk (IHDR chunk) and finish with the end chunk (IEND chunk)
The main chunks (called critical chunks) are:
The other chunks (called ancillary chunks) are the following: