Home » File types » Image files » PNG (Portable Network Graphics, .png)

PNG (Portable Network Graphics, .png)

Portable Network Graphics (PNG) is a bitmapped image format that employs lossless data compression. PNG was created to improve upon and replace the GIF format, as an image-file format not requiring a patent license. The PNG initialism is optionally recursive, unofficially standing for "PNG's Not GIF".

PNG supports palette-based (palettes of 24-bit RGB colors) or greyscale or RGB images. PNG was designed for transferring images on the Internet, not professional graphics, and so does not support other color spaces (such as CMYK).

PNG files nearly always use file-extension "PNG" or "png" and are assigned MIME media type "image/png" (approved October 14, 1996).

PNG images can either use palette-indexed color or be made up of one or more channels (numerical values directly representing quantities about the pixels). When there is more than one channel in an image all channels have the same number of bits allocated per pixel (known as the bitdepth of the channel). Although the PNG specification always talks about the bitdepth of channels, most software and users generally talk about the total number of bits per pixel (sometimes also referred to as bitdepth or color depth). Since multiple channels can affect a single pixel, the number of bits per pixel is often higher than the number of bits per channel.

The number of channels will depend on whether the image is greyscale or color and whether it has an alpha channel. PNG allows the following combinations of channels:

  • indexed (channel containing indexes into a palette of colors)
  • greyscale
  • greyscale and alpha (level of transparency for each pixel)
  • red, green and blue (rgb/truecolor)
  • red, green, blue and alpha

With indexed color images, the palette is always stored in RGB at a depth of 8 bits per channel (24 bits per palette entry). The palette must not have more entries than the image bitdepth allows for but it may have fewer (so if an image for example only uses 90 colors there is no need to have palette entries for all 256).

Indexed color PNGs are allowed to have 1, 2, 4 or 8 bits per pixel by the standard; greyscale images with no alpha channel allow for 1, 2, 4, 8 or 16 bits per pixel. Everything else uses a bitdepth per channel of either 8 or 16. The standard requires that decoders can read all supported color formats but many image editors can only produce a small subset of them.

PNG offers a variety of transparency options. With truecolor and greyscale images either a single pixel value can be declared as transparent or an alpha channel can be added. For paletted images, alpha values can be added to palette entries. The number of such values stored may be less than the total number of palette entries, in which case the remaining entries are considered fully opaque.

The scanning of pixel values for binary transparency is supposed to be performed before any color reduction to avoid pixels becoming unintentionally transparent. This is most likely to pose an issue for systems that can decode 16 bits per channel images (as they must be compliant with the specification) but only output at 8 bits per channel (the norm for all but the highest end systems).

  
How to convert PNG files to other image file formats
Batch convert PNG to GIF

This is a command line script to convert all .PNG-files to .GIF. We will show you how to convert .png-files by right clicking on a folder. All the png-images will then be converted to gif and saved in a sub folder (named ´gif). Read more...

Batch convert PNG to BMP

This is a command line script to convert all .PNG-files to bmp. We will show you how to convert .png-files by right clicking on a folder. All the png-images will then be converted to bmp and saved in a sub folder (named ´bmp). Read more...

Batch convert PNG to TIF

This is a command line script to convert all .PNG-files to TIF. We will show you how to convert .png-files by right clicking on a folder. All the png-images will then be converted to tif and saved in a sub folder (named ´tif). Read more...

Batch convert PNG to JPG

This is a command line script to convert all .PNG-files to JPG. We will show you how to convert .png-files by right clicking on a folder. All the png-images will then be converted to jpg and saved in a sub folder (named ´jpg). Read more..