PNG-8 vs PNG-24 vs PNG-32: Color Depth and Transparency Explained
Correct ambiguous naming and map palette, truecolor, alpha and bit depth to real export choices.
How PNG Export Modes Map to the W3C Specification
Most image editors and converters offer three PNG export options labeled PNG-8, PNG-24, and PNG-32. These labels are marketing shorthand, not terms from the W3C PNG specification. They describe total bits per pixel but obscure the underlying structural differences that determine whether an image will display correctly, waste bandwidth, or lose data permanently.
The W3C specification (PNG Specification, Third Edition) defines images by color type and bit depth, not by these commercial labels. Understanding the mapping prevents export mistakes that cause gradient banding, clipped transparency, or unnecessarily large files.
The Three Export Modes and Their Specification Equivalents
PNG-8 corresponds to color type 3 (indexed-color) at 8 bits per pixel. Each pixel stores an index into a palette containing up to 256 entries. Each palette entry is 24-bit RGB (8 bits per channel). Transparency is possible only through a single tRNS chunk that marks one palette index as fully transparent. There is no per-pixel alpha channel. The specification also permits indexed-color at 1, 2, and 4 bits per pixel, but exporters using the "PNG-8" label always mean 8 bits.
PNG-24 corresponds to color type 2 (truecolor) at 8 bits per sample. Each pixel stores three 8-bit channels (red, green, blue) for a total of 24 bits. No alpha channel exists. The specification also defines truecolor at 16 bits per sample (48 bits per pixel), but "PNG-24" specifically means 8-bit samples.
PNG-32 corresponds to color type 6 (truecolor with alpha) at 8 bits per sample. Each pixel stores four 8-bit channels (red, green, blue, alpha) for a total of 32 bits. This is the only standard PNG color type that supports per-pixel alpha transparency with 256 levels of opacity. The specification also defines this type at 16 bits per sample (64 bits per pixel).
The critical structural distinction: PNG-8 uses a palette lookup table with indexed pixels; PNG-24 and PNG-32 use direct color values per pixel. These are not compression settings. They are fundamentally different storage formats, as defined in the specification's color type definitions.
When Each Export Mode Is Appropriate
Indexed-Color (PNG-8): Flat Graphics With 256 or Fewer Colors
Use this mode for images containing only fully opaque or fully transparent pixels, with a total distinct color count of 256 or fewer. Typical candidates include logos with flat fills, icons with hard edges, pixel art, and diagrams.
Verification test: Count the distinct colors in the source image. With ImageMagick, run identify -verbose image.png | grep "Colors:". If the count is 256 or fewer and no pixel has partial opacity, PNG-8 preserves the image exactly while producing the smallest file.
Explicit limitation: If the source contains more than 256 colors, the exporter must quantize the image. This reduces the color palette by merging similar colors, producing posterization and banding in gradients. This loss is irreversible once the file is saved. No conversion from PNG-8 back to PNG-24 or PNG-32 can recover the discarded color information.
Transparency limitation: Indexed-color transparency is binary. A palette entry is either fully transparent or fully opaque. Anti-aliased edges, drop shadows, and soft glows require per-pixel alpha and cannot be stored in PNG-8 without visible degradation.
Truecolor Without Alpha (PNG-24): Opaque Images With Many Colors
Use this mode for photographs, detailed illustrations, or any image with more than 256 colors that does not require transparency. Each pixel receives 8 bits per RGB channel, yielding 16.7 million possible colors without quantization.
Verification test: Examine the image at 800% zoom. If every pixel is fully opaque and the image contains gradients, photographic detail, or more than 256 colors, PNG-24 is the correct choice. Saving as PNG-32 adds an alpha channel where every value is 255 (fully opaque), increasing file size by approximately one-third with no visual benefit.
Explicit limitation: A PNG-24 file cannot later gain transparency. Adding alpha requires re-encoding as color type 6 (PNG-32) from the original layered source. The PNG-24 file itself contains no alpha channel to "enable."
Truecolor With Alpha (PNG-32): Images Requiring Per-Pixel Transparency
Use this mode when any pixel in the image has partial opacity. This includes anti-aliased edges against transparent backgrounds, drop shadows, glows, reflections, and any graphic intended for compositing over varying backgrounds.
Verification test: In an image editor, zoom to 800% on an edge between the graphic and its background. If any pixel shows a checkerboard pattern at reduced opacity, the image requires PNG-32. If every pixel is either fully opaque or fully transparent, PNG-8 with a single transparent palette entry can store the image in a smaller file.
Explicit limitation: A PNG-32 file where every alpha value is 255 wastes approximately 25% of its size on unused alpha data. Before exporting, verify that the alpha channel contains actual transparency. Tools like pngcheck -v image.png report the color type; if it is 6 and the image has no semi-transparent regions, re-export as PNG-24.
Irreversible Data Loss During Conversion
Converting between these modes causes specific, permanent damage. The specification's color types are structural, not interchangeable.
PNG-32 to PNG-24: The alpha channel is discarded entirely. Semi-transparent pixels are composited against a matte color (typically white or black, depending on the exporter). Soft edges become hard and aliased. Even if the alpha channel appeared empty, the conversion is destructive because the file structure changes from color type 6 to color type 2.
PNG-24 to PNG-8: The 16.7-million-color space is reduced to a 256-entry palette. Images with gradients or photographic content will show visible banding and posterization. The quantization algorithm chooses which colors to preserve; subtle variations are lost.
PNG-32 to PNG-8: Both color quantization and alpha binarization occur simultaneously. Each RGBA pixel must map to a single palette entry. Semi-transparent pixels are forced to either fully opaque or fully transparent based on a threshold, typically 50% opacity. The result is acceptable only for simple graphics that never had partial transparency to begin with.
No conversion in the opposite direction (PNG-8 to PNG-24, PNG-24 to PNG-32) recovers lost data. The new file has the structure of the target color type but contains only the information present in the source.
Application-Specific Rendering Inconsistencies
Different software handles indexed-color transparency differently, even when the PNG file is specification-compliant.
Web browsers (Chrome, Firefox, Safari, Edge) render all three color types correctly, including tRNS-based transparency in indexed-color images.
Adobe Photoshop opens indexed-color PNGs but immediately converts them to an internal RGB representation. Re-saving without explicitly selecting an indexed export option produces a truecolor file, often larger than the original.
Microsoft PowerPoint and Word (Windows desktop versions) sometimes fail to render tRNS transparency in indexed-color PNGs, displaying a solid white or black rectangle instead. For documents destined for these applications, PNG-32 is the reliable choice despite the larger file size.
macOS Finder and Preview respect all three color types, but the Finder thumbnail generator may render transparency in indexed-color PNGs as a black background in icon previews. The file itself is intact and displays correctly when opened.
If a PNG-8 image with transparency displays correctly in a browser but shows an opaque background in a specific application, the application does not support palette-based transparency. The only reliable workaround is to re-export as PNG-32.
Diagnostic Steps for Existing PNG Files
Identify the color type without relying on the filename or extension. Run
pngcheck -v image.png(available at libpng.org). The output includes acolor typefield: 3 is indexed (PNG-8), 2 is truecolor (PNG-24), 6 is truecolor with alpha (PNG-32).Verify whether alpha data is actually used. For a color type 6 file, examine the alpha channel statistics. If every alpha sample is 255, the file is carrying unused alpha data. Re-export as color type 2 to reduce size.
Test indexed-color viability on a copy. Reduce the source image to 256 colors using your editor's quantization function. Compare the original and quantized versions side by side at 200% zoom. If no difference is visible, the image can be stored as PNG-8 without quality loss.
Measure the alpha overhead. Export the same source as both PNG-24 and PNG-32. If the PNG-32 file is approximately 33% larger, the alpha channel contains no useful transparency data. Use the PNG-24 version.