Book a call Free rebuild

PNG

April 22, 2026 Updated November 16, 2026 3 min read

Design glossaryPNG is a lossless image format that supports transparency. It suits logos, icons, and screenshots; for photos, JPEG, WebP, or AVIF are smaller.

PNG, Portable Network Graphics, was designed in the mid-1990s as a free, patent-unencumbered replacement for GIF, whose compression method was then under patent. It became a W3C Recommendation in 1996 and is now supported everywhere. Its two defining features are lossless compression, so every pixel comes back exactly as saved, and a full alpha channel, so edges can fade smoothly into whatever is behind the image.

How PNG works

Before compressing, PNG runs each row of pixels through a filter that records the differences between neighboring pixels rather than the raw values. Flat colors and smooth gradients turn into long runs of small, repetitive numbers, which the DEFLATE algorithm (the same one used in ZIP and gzip) then compresses well. Photographs, where almost every pixel differs from its neighbor, compress poorly.

A PNG file is made of chunks. Critical chunks hold the header, the image data, and the end marker; optional chunks can hold text, gamma, and color profile information.

PNG comes in several color types. Truecolor PNG (often called PNG-24, or PNG-32 with transparency) stores millions of colors. Palette PNG (PNG-8) stores up to 256 colors, like GIF, but can still give each palette color partial transparency. Animated PNG (APNG) also exists and is supported by modern browsers, though it is rarely used.

When to use PNG

  • Good for: screenshots, interface graphics, diagrams, illustrations with flat color, images containing text, and logos when SVG is not an option. Transparency makes it the usual raster choice for logos over colored backgrounds.
  • Poor for: photographs. A photo saved as PNG is usually much larger than a good JPEG with no visible gain. Use JPEG, WebP, or AVIF for photos; WebP and AVIF also support transparency.
  • Not a substitute for vectors: PNG is a raster format, so enlarging it makes it blurry. Logos and icons are best as SVG (see vector image).

Making PNGs smaller

  • Export at the size you need. Dimensions affect file size more than anything else.
  • Reduce the palette. Tools such as pngquant convert truecolor PNGs to palette PNGs, often cutting size dramatically with little visible change. This step is lossy.
  • Optimize losslessly. Tools such as oxipng try better filters and compression settings without changing a pixel.
  • Consider WebP. Lossless WebP is usually smaller than PNG for the same image.

In WordPress, an image optimization plugin can apply these steps on upload. Watch out for screenshots and large graphics saved as PNG by default: they are a common cause of heavy pages. See image compression for more.

FAQs

What is a PNG file and what is it used for?

A PNG is a raster image file that uses lossless compression and supports full transparency. It is used for screenshots, logos, icons, diagrams, and other graphics with sharp edges, text, or flat colors, where quality must be exact.

How does PNG compression work?

PNG first filters each row of pixels to store the differences between neighboring pixels, then compresses the result with the DEFLATE algorithm. No image data is discarded, so the decoded image is identical to the original. It compresses flat color well and photographs poorly.

What are PNG chunks and why are they important?

A PNG file is a series of chunks. Critical chunks such as IHDR (the header with size and color type), IDAT (the image data), and IEND (the end marker) must be present for the file to open. Optional chunks store extras such as text, gamma, and color profiles, and stripping unneeded ones is one way to shrink a file.

How can I open a PNG file?

Every web browser, operating system image viewer, and image editor can open PNG files. Double-clicking one usually opens it in the default viewer, and dragging it into a browser window displays it.

Is PNG better than JPG or GIF?

It depends on the image. PNG beats JPEG for graphics, screenshots, text, and anything needing transparency, while JPEG is far smaller for photographs. PNG is better than GIF for still images, with more colors and smooth transparency. For many web images, WebP or AVIF are smaller than either.

WP Services

WordPress services at revolutionary pricing.

Productized WordPress services, from builds to care, delivered by Seahawk and tracked in one app. For the WordPress lovers.