Kompres
← Back to Blog

Why Is My PNG Still Large? PNG8 Palette Compression Explained

PNG is lossless, so a JPEG-style quality slider does not apply

PNG encodes its represented pixel values without JPEG-style quantization. It predicts neighboring pixels and compresses the remaining byte patterns. Recompressing a highly optimized PNG with the same pixels may save little because its representation is already compact.

For a substantial reduction, you often need to change the pixel representation: shrink dimensions or convert many colors into a limited indexed palette. The resulting PNG still decodes its palette indices exactly, but palette conversion may have changed colors beforehand. "PNG is lossless" does not mean palette reduction is visually risk-free.

Indexed PNG versus true-color PNG

A true-color PNG describes each pixel with red, green, and blue values, potentially with an alpha channel. An indexed PNG (often called PNG8) stores a small table of colors and lets pixels refer to table entries. If the graphic really uses only a limited set of colors, this can be much cheaper.

The palette can contain up to 256 entries. A flat logo may need only 16; a screenshot with colored text might need 128 or 256. A landscape photo contains many more subtle shades. Forcing it into 256 colors can create bands in skies and speckles in foliage.

What quantization and dithering actually do

Color quantization groups nearby source colors into representative palette entries. Dithering scatters neighboring palette colors to approximate an unavailable shade. Dithering can hide a band at normal viewing size, but its added noise may increase file size or make fine text look dirty. Evaluate both size and appearance.

Image Useful starting palette Main risk
Simple icon or logo 16–32 colors Jagged antialiased edges
Flat illustration 32–64 colors Broken gradients
UI screenshot 64–128 colors Colored halos around text
Detailed chart 128–256 colors Missing small labels or grid lines
Photograph Usually avoid palette PNG Banding and false color

Begin at 256 colors and move downward one step at a time. In the PNG compressor, compare the same text and gradient regions after each preview; when damage appears, return to the previous setting. Keep Lossless selected if exact pixels matter more than size.

Transparency needs its own inspection

Palette conversion may simplify soft transparency. A feathered shadow or antialiased edge can become visibly hard when its alpha values cannot be represented well. Inspect the image on both light and dark backgrounds. If smooth transparency is essential, compare transparent WebP or retain true-color PNG.

A practical PNG workflow

  1. Confirm the image is actually a graphic, screenshot, or transparency asset. A photo may be better as JPEG or WebP.
  2. Keep the original and run one automatic compression pass.
  3. If the result is still too large, turn off Lossless only when a palette change is acceptable.
  4. Test 256, 128, 64, and fewer colors in stages, comparing text, edges, gradients, and transparency.
  5. Save only when the smaller file still serves its intended purpose.

Fewer colors is not automatically better, and a photographic PNG cannot generally be made tiny without changing its appearance. The full tutorial shows the palette control and comparison preview. Image processing takes place in the browser, but if the tool keeps an untouched original because re-encoding would enlarge it, metadata in that original is retained too.