Article
Nov 29, 2026
Understanding PNG Images: Transparency, Lossless Storage, and Graphic Quality
PNG images are stored in a raster format that compresses without any loss and can hold partial transparency. Because every decoded pixel is preserved exactly, it keeps text, lines, and edges crisp, and it supports soft shadows on any background. The price is file size: photographs usually become much larger as PNG than as JPG.
PNG appeared in the mid-1990s as a patent-free answer to GIF and is now the standard lossless format of the web. It is also one of the most misunderstood formats, because people assume lossless means small or that PNG is automatically better than JPG. This guide shows how PNG stores data, why transparency works the way it does, what drives file size, and how to choose between PNG and its alternatives.
Key Points
- PNG compression is lossless, so repeated saving never degrades the pixels.
- An alpha channel stores many levels of opacity, which gives smooth edges on any background.
- Indexed PNG uses a palette of up to 256 colors and can be far smaller for simple graphics.
- PNG does not support CMYK, and plain PNG does not animate.
- Photographs are often several times larger as PNG than as JPG.
- Converting JPG to PNG preserves existing artifacts instead of removing them.
KEY TAKEAWAY
“Lossless means nothing is thrown away, not that nothing is large. PNG protects exactness, and exactness costs bytes.”
How a PNG File Is Built
A PNG begins with an eight-byte signature and then continues as a series of chunks. Each chunk has a type, a length, its data, and a checksum, which makes damage easy to detect. The header chunk records width, height, bit depth, and color type. One or more data chunks hold the compressed pixels, and optional chunks can carry a palette, gamma, an embedded color profile, text and, in newer revisions, EXIF metadata.
Before compression, each row of pixels is passed through a filter that predicts every value from its neighbours and stores only the difference. Filtering turns smooth areas into long runs of small numbers, which compress very well. The filtered rows are then compressed with the DEFLATE algorithm, the same family used in ZIP files. Encoders that try several filter strategies per row, or that use stronger DEFLATE settings, can produce noticeably smaller files from identical pixels.
Color type | Channels | Typical use |
| Grayscale | One brightness channel | Scans and simple diagrams |
| Grayscale with alpha | Brightness plus opacity | Soft-edged monochrome overlays |
| Truecolor (RGB) | Red, green, blue | Screenshots and photographic graphics |
| Truecolor with alpha (RGBA) | RGB plus opacity | Logos and cut-out images with soft edges |
| Indexed color | A palette of up to 256 colors | Flat-color graphics where size matters |
Transparency in Detail
PNG offers two transparency mechanisms. In indexed images, palette entries can carry opacity values. In truecolor and grayscale images, a full alpha channel stores opacity for every pixel, usually with 8 or 16 bits. A pixel can be completely clear, completely solid, or anywhere in between, so the anti-aliased edge of a letter blends smoothly into a white page, a photograph, or a dark theme alike. By comparison, GIF marks pixels as either on or off, which leaves jagged halos when the background color differs from the one used while exporting.
A frequent surprise is that previews often paint transparent areas white or gray. To check that transparency survived, place the file on a colored or dark background in a browser or editor. If a white box appears there, the white was genuinely part of the image.
What Controls PNG File Size
Factor | Effect on size | What you can do |
| Pixel dimensions | Size grows roughly with the number of pixels | Resize to the displayed dimensions |
| Image content | Flat color compresses well; noise and photographic gradients do not | Consider JPG or WebP for photographs |
| Bit depth | 16-bit channels roughly double the raw data | Use 8 bits unless editing needs more |
| Color type | Indexed images are much smaller than RGBA | Reduce flat graphics to a palette where colors allow |
| Encoder effort | Better filtering and DEFLATE can shrink the file without any pixel change | Run an optimizer |
| Metadata | Text chunks and profiles add bytes | Strip what you do not need, but keep a needed color profile |
Palette reduction deserves a caution. Converting a graphic with a handful of colors to an indexed PNG is lossless. Converting a graphic with thousands of colors to 256 is lossy, because some colors must be merged. Check the result visually, particularly in gradients and anti-aliased edges.
Where PNG Excels
- Screenshots and tutorials: text and interface lines remain crisp.
- Logos and icons with soft edges: alpha transparency avoids halos.
- Intermediate files: a lossless working copy that can be saved repeatedly.
- Charts and diagrams: flat areas compress efficiently.
- Images that need exactness: pixel art and masks must keep every value.
Where PNG Is a Poor Fit
Large photographs are the main weakness. A smooth, noisy photographic gradient gives the filter little to predict, so the result can be several times larger than a well-made JPG with no visible benefit. Print production is another poor fit, since PNG has no CMYK mode. Animation is possible only through the APNG extension, which is less widely supported than GIF outside browsers.
PNG Compared With Neighbouring Formats
Compared with | PNG advantage | PNG disadvantage |
| JPG | Lossless, transparency, crisp edges | Much larger for photographs |
| WebP | Near-universal software support | Lossless WebP is often smaller |
| GIF | Millions of colors, soft transparency | No animation in standard PNG |
| SVG | Handles photographic and complex raster content | Does not scale cleanly |
| TIFF | Web-friendly and widely displayed | No CMYK or multi-page support |
The JPG guide describes the lossy alternative in depth, and the WebP guide covers the format that most often replaces PNG on websites.
Converting to and From PNG
The SnapZain Image Format Converter accepts PNG as an input and an output, along with JPG, GIF, WebP, AVIF, BMP, HEIC, ICO, TIFF, and SVG, up to 20 MB per file. The tool's page lists a few behaviors worth knowing.
- PNG to JPG: transparent pixels are flattened onto white, and the picture gains a lossy compression step.
- GIF to PNG: the page says multi-frame sources may be flattened, so expect a still image.
- WebP, AVIF, or BMP to PNG: a safe route when a program accepts only PNG.
- SVG to PNG: this rasterizes the vector at one size, and the page notes that SVG input depends on a server component.
- PNG to SVG: the SVG output wraps the bitmap and does not trace it into paths.
Practical PNG Scenarios
The same format behaves very differently depending on what you feed it. Looking at typical cases makes the earlier principles concrete, and shows where a quick change of settings pays off.
Scenario | What usually happens | Sensible action |
| A website screenshot with text and flat panels | Small, perfectly sharp file | Keep PNG; run a lossless optimizer |
| A product photo exported as PNG for a shop page | File several times larger than needed | Export a lossy WebP or JPG for the page and keep PNG as the master |
| A logo with soft drop shadow | PNG with alpha blends well on any background | Keep PNG, or rebuild as SVG if the artwork is geometric |
| A four-color chart | RGBA export is wastefully large | Reduce to an indexed palette and compare visually |
| A scan of a printed page | Large, with noisy paper texture | Threshold to black and white or use a lossy format for casual sharing |
A useful habit is to export a PNG once, check its size against the displayed dimensions, and only then decide whether an optimizer or a different format is warranted. Doing the checks in that order avoids polishing a file that should never have been a PNG.
Common PNG Mistakes
- Using PNG for every photograph: pages become heavy for no visible benefit.
- Exporting a logo as JPG: a white rectangle replaces the transparent area.
- Keeping 16-bit data for web graphics: halves efficiency with no visible gain.
- Removing the color profile blindly: colors can shift between devices.
- Assuming a white preview means no transparency: test on a dark background.
Conclusion
PNG is the dependable lossless choice for anything where edges, text, and transparency must stay exact. It is not a universal upgrade over JPG, because the same exactness makes photographs expensive to store. Use PNG for graphics, screenshots, and working copies; use a lossy format for photographs, and let an optimizer trim the bytes without touching a pixel.
Frequently Asked Questions
Why was PNG created when GIF already existed?
PNG, short for Portable Network Graphics, was designed in the mid-1990s as a free, open alternative to GIF after patent concerns about GIF's compression arose. It also added more colors and true alpha transparency.
Is PNG always larger than JPG?
No. For flat graphics and screenshots, PNG is often smaller, while for photographs it is usually far larger.
Does resaving a PNG lower its quality?
No, the pixels stay identical. Quality can only change if the software resizes the image, changes color handling, or removes layers.
Should I choose PNG-8 or PNG-24 for a graphic?
Use PNG-8 when the artwork has few flat colors and size matters, and PNG-24 when it has gradients or many colors. Adding alpha to PNG-24 is informally called PNG-32.
Why does my transparent PNG show a white box?
The viewer may paint transparency white, or the image may contain real white pixels. View it on a dark or colored background to tell the difference.
Can PNG store a photograph with a transparent background?
Yes, but the file will be large. Lossy WebP or AVIF can store the same cut-out at a much smaller size where they are supported.
What are PNG filters?
Filters predict each pixel from its neighbours and store the difference, which makes the data more compressible. Encoders pick a filter per row, and better choices give smaller files.
Is 16-bit PNG useful on websites?
Rarely. Browsers display 8-bit output, so 16-bit data mostly adds weight. It is useful for editing and scientific images.
Can I make a PNG smaller without changing how it looks?
Yes. Lossless optimizers re-compress the same pixels with better settings, and stripping unneeded metadata also helps.
Does PNG support animation?
Standard PNG does not. The APNG extension adds frames, and many modern browsers display it, but other software may show only the first frame.
How is PNG better than GIF for transparency?
PNG stores many opacity levels per pixel, so edges blend smoothly. GIF stores one on-off color and leaves visible fringes.
Why is a screenshot smaller as PNG than as JPG?
Flat colors and straight edges compress well losslessly, while JPG adds ringing around edges and does not always save space on such images.
Can PNG be used for print?
It can print, but it has no CMYK mode and limited print-oriented features. TIFF or PDF is the usual choice for press work.
What is interlacing in PNG?
Interlacing stores the image in passes so a rough preview appears early. It can enlarge the file and is rarely needed on fast connections.
Do PNG files hold metadata?
Yes, through text chunks, color profile chunks, and, in newer revisions, EXIF. Software support for reading these differs.
How do I convert a JPG logo to a transparent PNG?
Converting the format alone will not remove the background. You need an editor to erase the background or rebuild the logo from a vector source.
Is lossless WebP better than PNG?
Often it is smaller and still supports alpha, but PNG opens in more software. Choose according to your audience and tools.
Why do PNG colors shift between programs?
Programs treat embedded color profiles and gamma information differently. Keeping a standard sRGB profile avoids most differences.
What happens if I convert PNG to JPG?
The image is re-encoded with lossy compression, and any transparency is replaced by a solid color. The SnapZain converter flattens it onto white.
Does PNG compress as well for pixel art?
Yes. Pixel art has large flat regions and few colors, so indexed PNG is both small and exact.
Should I choose PNG for a website banner?
Only if it is a flat graphic with sharp text. A photographic banner is better as a JPG, WebP, or AVIF to keep the page light.