PNG - Portable Network Graphics
PNG is a lossless image format with real transparency, created as a free replacement for GIF. It is what screenshots, logos and exported charts are usually saved as.
PNG stands for Portable Network Graphics. It was designed in the mid-1990s by developers who needed a replacement for GIF, because the compression method GIF relied on was covered by a patent at the time. The result was a free, well-documented format that keeps every pixel exactly as it was, later adopted as a standard by the World Wide Web Consortium and by ISO. Today a PNG is what you get from the screenshot key, a logo export or a chart saved out of a spreadsheet.
How a PNG stores its picture
PNG is lossless: the file is compressed, but nothing is discarded, and decoding it returns the original pixels exactly. It works in two stages. First a filtering step rewrites each row of pixels as the difference from its neighbours, which turns smooth areas into long runs of very small numbers. Then a general-purpose compressor squeezes those numbers, using the same method as a ZIP archive.
A PNG is built as a chain of labelled blocks called chunks. Three kinds are mandatory: one describing the image size, colour type and bit depth, one or more carrying the compressed pixel data, and one marking the end. Everything else is optional, which is what makes the format extensible. PNG can store greyscale, indexed colour with a palette, or full colour at 8 or 16 bits per channel, and it has a true alpha channel, meaning every pixel can be fully opaque, fully transparent or anywhere in between. That is why PNG is the format for logos and interface graphics with soft edges. The base format holds one still image; animation exists only through a later extension called APNG.
What metadata a PNG carries
Metadata is the descriptive information stored in the file next to the pixels. PNG keeps it in optional chunks; text can be plain, compressed, or tagged with a language so the same field appears in several translations.
- Registered text keywords are the simple ones, and a report lists them by name:
Title,Author,Description,Copyright,Creation Time,Software,Source,Comment,DisclaimerandWarning.Softwareis the one you see most often, because most editors stamp their own name into it. - XMP, Adobe's XML-based metadata standard, is carried inside a language-tagged text chunk. This is where creator, keywords, ratings and an edit history listing the programs that modified the image tend to live.
- EXIF, the camera metadata standard, was not part of the original specification but was added later as a chunk of its own. So a PNG can carry a full camera block including GPS coordinates, although it usually only does when the file was converted from a photograph.
- Colour and display chunks count as metadata too: an embedded ICC colour profile, gamma and chromaticity values, a background colour, and a physical-resolution chunk recording pixels per metre, which is where an image's DPI figure comes from.
A screenshot or an exported graphic is normally far less revealing than a camera photo, but do not assume a PNG is anonymous. Converting a JPG to PNG can carry the original EXIF and GPS data straight across. Editors write your name into the author or XMP creator field if it is filled in in their preferences. And the Software and edit-history entries quietly announce which program, and sometimes which version of it, produced the file.
When to use PNG
Use PNG whenever the pixels have to stay exact or the image needs transparency: screenshots, diagrams, charts, logos, icons, flat-colour artwork and anything containing text. Sharp edges stay sharp, and repeated saves never degrade the picture.
Against JPG the trade is simple. For a photograph, a PNG is typically several times larger for no visible gain, so photographs belong in JPG or in a newer format such as WebP or HEIC. Against GIF, PNG wins outright for still images: full colour instead of 256 shades, and proper partial transparency instead of a single see-through colour. GIF's one remaining advantage is animation.