PNG

The PNG working group designed the format for transferring images on the Internet, not for professional-quality print graphics; therefore, non-RGB color spaces such as CMYK are not supported.

A PNG file contains a single image in an extensible structure of chunks, encoding the basic pixels and other information such as textual comments and integrity checks documented in RFC 2083.

One of them was Thomas Boutell, who on 4 January 1995 posted a precursory discussion thread on the Usenet newsgroup "comp.graphics" in which he devised a plan for a free alternative to GIF.

Other suggestions later implemented included the deflate compression algorithm and 24-bit color support, the lack of the latter in GIF also motivating the team to create their file format.

APNG is a format that is natively supported by Gecko- and Presto-based web browsers and is also commonly used for thumbnails on Sony's PlayStation Portable system (using the normal PNG file extension).

The original PNG specification was authored by an ad hoc group of computer graphics experts and enthusiasts.

If a decoder encounters a critical chunk it does not recognize, it must abort reading the file or supply the user with an appropriate warning.

Other image attributes that can be stored in PNG files include gamma values, background color, and textual metadata information.

The standard requires that decoders can read all supported color formats, but many image editors can only produce a small subset of them.

Note they are easy to identify because of their human readable type names (in this example PNG, IHDR, IDAT, and IEND).

Using PNG instead of a high-quality JPEG for such images would result in a large increase in file size with negligible gain in quality.

JPEG was commonly used when exporting images containing gradients for web pages, because of GIF's limited color depth.

A PNG format reproduces a gradient as accurately as possible for a given bit depth, while keeping the file size small.

PNG became the optimal choice for small gradient images as web browser support for the format improved.

The high level of extensibility also means that most applications provide only a subset of possible features, potentially creating user confusion and compatibility issues.

[61] The main improvements of WebP over PNG, however, are the large reduction in file size and therefore faster loading times when embedded into websites.

[62] WebP has received criticism for being incompatible with various image editing programs and social media websites, unlike PNG.

AVIF was designed by the foundation to make up for the shortcomings of other image codecs, including PNG, GIF, and WebP.

[70] Despite calls by the Free Software Foundation[71] and the World Wide Web Consortium (W3C),[72] tools such as gif2png,[73] and campaigns such as Burn All GIFs,[74] PNG adoption on websites was fairly slow due to late and buggy support in Internet Explorer, particularly regarding transparency.

[75] PNG compatible browsers include: Apple Safari, Google Chrome, Mozilla Firefox, Opera, Camino, Internet Explorer, Microsoft Edge and many others.

Especially versions of Internet Explorer (Windows) below 9.0 (released 2011) had numerous problems which prevented it from correctly rendering PNG images.

This is attributed to the performance of PNG's DEFLATE compared to GIF's LZW, and because the added precompression layer of PNG's predictive filters take account of the 2-dimensional image structure to further compress files; as filtered data encodes differences between pixels, they will tend to cluster closer to 0, rather than being spread across all possible values, and thus be more easily compressed by DEFLATE.

However, some versions of Adobe Photoshop, CorelDRAW and MS Paint provide poor PNG compression, creating the impression that GIF is more efficient.

Many graphics programs (such as Apple's Preview software) save PNGs with large amounts of metadata and color-correction data that are generally unnecessary for Web viewing.

Unoptimized PNG files from Adobe Fireworks are also notorious for this since they contain options to make the image editable in supported editors.

Adobe Photoshop's performance on PNG files has improved in the CS Suite when using the Save For Web feature (which also allows explicit PNG/8 use).

When saved with the Export option, Fireworks' PNGs are competitive with those produced by other image editors, but are no longer editable as anything but flattened bitmaps.

Although pngout offers both, only one type of filter can be specified in a single run, therefore it can be used with a wrapper tool or in combination with pngcrush,[note 2] acting as a re-deflater, like advdef.

By contrast, advdef from the same package doesn't deal with PNG structure and acts only as a re-deflater, retaining any existing filter settings.

At least one icon editor, Pixelformer, is able to perform a special optimization pass while saving ICO files, thereby reducing their sizes.

The PNG image viewed with a hex editor application for Ubuntu
A demonstration of the color depth in a PNG file, in bits per channel. Left: 8 bits; Right: 16 bits. Note the artifacts , adjusted contrast for clarity.
PNG's filter method 0 can use the data in pixels A, B, and C to predict the value for X.
A PNG with 256 colors, which is only 251 bytes large with pre-filter. The same image as a GIF would be more than thirteen times larger.
An illustration of Adam7 interlacing over a 16×16 image
An APNG (animated PNG) file (displays as static image in some web browsers )
Composite image comparing lossy compression in JPEG with lossless compression in PNG: the JPEG artifacts can be easily visible in the background of this kind of image data, where the PNG image has solid color.