Why a Truecolor PNG Color Key Leaves a Colored Fringe
Compare neighboring RGB values to see when a truecolor PNG color key leaves an opaque fringe.


The background disappears in a PNG export, yet a purple edge stays visible. In a truecolor PNG, a tRNS color key makes one exact RGB value transparent. It cannot store separate partial alpha values for antialiased edges.
Test three pixels before retouching the art
Make a three-pixel, eight-bit RGB row using (255,0,255), (254,0,255) and (0,200,255). Encode it as PNG with the first RGB triplet as the tRNS key. Decode a copy to RGBA and inspect the alpha values. Expect zero, 255 and 255. The two magentas look close but only the exact match disappears.
Decide whether the edge needs full alpha
Inspect the result over a light and a dark backing. Check the edge RGB and alpha before blaming the preview. If an opaque edge was already blended with the magenta matte, merely saving it as RGBA preserves that color. Use an original with transparency or reconstruct the mask and foreground edge before exporting again.
Use the asset compression tool for an optimization comparison, then inspect the actual deliverable in the receiving application. Record the PNG color type, key and edge sample. Indexed PNG transparency is a separate case because palette entries can carry their own alpha.
Ready to try "Why a Truecolor PNG Color Key Leaves a Colored Fringe"?
Use our online tools to apply this tutorial to your indie game project right away.
