AI & Tech · 5 min read
True-Alpha PNG: Why Your AI Art Has a White Halo
By DesiStudio Team · April 8, 2026
If your AI art shows a white edge in Unity or Godot, the export is not the transparent PNG you think it is. Here is what is really happening under the hood — and why the fix has to happen at export time, not in your engine.
PNG color types, briefly
The PNG spec defines six color types. Only types 4 (grayscale + alpha) and 6 (RGBA) carry a real alpha channel. Type 2 is RGB only — anything that looks transparent is baked into the RGB values against a matte color.
When an engine composites a type-2 PNG onto a scene, the matte edges show through because there is no per-pixel opacity — the "transparent" pixels near the shape are actually opaque pixels the tool tried to blend into white or black. Zoom in and you can see the ring.
Why AI tools ship type 2
Diffusion models output RGB. Adding a proper alpha channel requires a matting step (or a model trained on RGBA). Shortcut: composite against white, save as type 2. Ship it. Users complain about halos.
The right fix — a segmentation pass that generates a per-pixel alpha mask, then a premultiply pass to avoid dark fringes — adds 100–300 ms per image and a few cents of GPU. Cheap generators skip it.
How DesiStudio solves it
Every export runs through a background segmenter, then writes color type 6 with correct premultiplied alpha. A Playwright test (`logo-transparency.spec.ts`) verifies the alpha channel on every release.
The segmentation model is tuned for game sprites specifically — it handles thin appendages (weapons, hair, capes) that generic subject-cutout models tend to eat, and it preserves partial transparency for glow effects and glass.
DesiStudio bundles true-alpha export across all image studios inside one credit-based subscription — the same balance powers all 14 studios (Sprite, Tile, Character, Parallax, Props, HUD, Logo, Idea, Extend, Asset, Code, 2D Game, Storyboard, Launch Kit), so you never juggle tools mid-project.
How to verify a PNG yourself
Open the file in Photoshop or GIMP over a checkerboard background. If edges show a coloured halo, the alpha is fake. In code, check that the IHDR chunk reports color type 6.
From the terminal: `pngcheck -v hero.png` prints the color type in one line. Or in Node: `require("pngjs").PNG.sync.read(fs.readFileSync("hero.png")).colorType === 6`. Automate this in CI and halo bugs cannot reach main.
Ready to try it?
Ship faster with DesiStudio — 14 AI studios on one credit balance.
Export true-alpha PNG free →Frequently asked questions
How do I know if my PNG has real transparency?
Open it in Photoshop or GIMP over a checkerboard background. If edges show a colored halo, the alpha is fake. In code, check that IHDR color type is 6.
Does DesiStudio export true-alpha PNG?
Yes — every image export is color type 6 (RGBA) with correct alpha, verified by an automated test on every release.
Can I fix a type-2 PNG after the fact?
Only imperfectly. You can run a chroma-key against the matte colour, but thin features and semi-transparent pixels get eaten. Better to re-export from a tool that outputs type 6.