If you judge a palette-reduced transparent PNG by PSNR over a white background, the number can rank samples in a different order than their edges do. A pair of measurements that tracks the edge more directly is the average alpha error over only the pixels that were semi-transparent in the source, plus a count of how many of them ended up fully opaque or fully transparent. On three samples reduced to 64 colors with pngquant 3.0.3 and dithering off, the edge errors were 2.65, 0.71 and 2.42 alpha levels, while PSNR over white read 43.2, 52.4 and 55.1 dB. The two lists do not sort the same way, and that is the whole reason to report both.
All three samples are self-made, generated by a script with fictional content, 800×800 RGBA each. Generated samples are flatter than real design files. Everything below is one run on one Apple-silicon Mac, so read each figure as "on these samples".
How the edge error is counted
Take every pixel whose source alpha is strictly between 0 and 255. For each one, compute the absolute difference between the source alpha and the output alpha, on the 0–255 scale, and average. That is the edge alpha error.
The second measurement is a count. Of the semi-transparent pixels in the source, how many became exactly 255, and how many became exactly 0. An average of 2.5 levels can hide a lot of pixels that jumped to opaque, so the count tells you which way the error leans.
What the three samples gave
T1 is a feathered circle with a soft edge about 28 px wide. T2 is a rounded card with a dark offset shadow. T3 is a triangle and lettering with only a 1 px antialiased edge. The share of semi-transparent pixels is computed here by dividing their pixel counts by 640,000, not a separate measurement.
| Sample | Semi-transparent pixels | Share of image | 256 colors: error / PSNR | 64 colors: error / PSNR |
|---|---|---|---|---|
| T1 feathered | 230,502 | 36.0% | 1.20 / 49.4 dB | 2.65 / 43.2 dB |
| T2 shadow | 142,722 | 22.3% | 0.03 / 65.1 dB | 0.71 / 52.4 dB |
| T3 hard edge | 12,954 | 2.0% | 0.77 / 63.3 dB | 2.42 / 55.1 dB |
Error is in alpha levels over the source semi-transparent pixels, PSNR is computed after compositing on white, and dithering is off in every row.
Measured, reading the table in order: going from 256 to 64 colors multiplied the feathered edge error by about 2.2, while the shadow's error moved by under one level (0.03 to 0.71), since a shadow is one color at many opacities. At 64 colors T3 has a higher edge error than T2 (2.42 against 0.71) but a higher PSNR (55.1 against 52.4 dB). At 256 colors the order agrees again (T3 at 0.77 and 63.3 dB, T2 at 0.03 and 65.1 dB), but the error differs about 25-fold (0.77 against 0.03) while PSNR differs by under 2 dB.
Where the semi-transparent pixels went
Measured on T1, pngquant never pushed a semi-transparent pixel to fully transparent. It did push some to fully opaque: 10,216 at 256 colors, 16,443 at 64 colors with dithering, and 19,482 at 64 colors without. On T2 at 64 colors without dithering, 1,176 pixels went to opaque and the maximum error was 32 levels.
Switching dithering on barely moved the average error on T1 (3.05 against 2.65).
Two cruder reductions look very different. Forcing alpha to two values, a hard 0 or 255 split at 128, gave an average error of 39.2 on T1, 25.1 on T2 and 20.9 on T3, with no semi-transparent pixel left. On the shadow sample 139,901 pixels went fully transparent, so the shadow vanished. Pillow's FASTOCTREE at 64 colors gave 7.60, 6.7 and 4.4, and it turned every originally opaque pixel slightly translucent (alpha 248 to 253 on T1, 254 on T2 and T3). No PSNR was taken for either of these, so how they would score over white is unknown.
Why PSNR over white hides most of it
This part is inference and was not measured separately. There are two likely causes, and the sample table is consistent with both.
First, PSNR averages over all 640,000 pixels, and the semi-transparent ones are only 2.0% of T3 and 22.3% of T2. An error confined to a thin band gets diluted by a large area that is exactly right. Second, composited on white, an alpha error is scaled by how far the pixel color is from white. A light or low-opacity edge pixel can be wrong in alpha and still land close to white. On a dark background the same error would show up differently, and that was not measured.
If that reading is right, the practical rule is to report the edge error and the opaque and transparent counts next to PSNR, and to composite on the background the asset will really sit on.
One way around the whole problem
If the edge has to stay exact, palette PNG was the wrong container on these samples. Lossless WebP kept alpha identical on the feathered sample, 0 differing pixels, at 45,314 bytes against the 126,939-byte original. The feathered and shadow samples also went through ImgIng https://imging.ai/ in a desktop browser. It picked WebP by default (quality 84, a lossy setting) and their edge error came out at 0; colour was not compared pixel by pixel.
Not checked here: real design files, other quantizers, other background colors, and PSNR for the two-level and octree outputs.

