PNG matte inverter
Invert only the alpha channel of a PNG — transparent becomes solid and solid becomes transparent — leaving RGB untouched so edges stay clean.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
Images are processed locally in your browser with Canvas and never uploaded.
Pick an image first (PNG / JPEG / WebP / GIF all work).
No result yet
Result
These are the real numbers from this run — copy them straight out.
Pick an image and the result shows up here.
What this tool does
- Turn a black-on-white icon into a transparent-background icon by inverting alpha instead of tracing it by hand.
- Build a knockout mask: invert a solid logo alpha to keep only the outline.
- Inspect the transparent region shape: after inversion the transparent area is the original solid area, so missed spots are obvious.
Example
Input
A 2×2 image with alpha [0, 128, 255, 255] (same RGB), default threshold invert
Output
Alpha becomes [255, 0, 0, 0]; the RGB channels are unchanged
The default threshold invert treats alpha ≥ 1 as solid (→ 0) and everything else as transparent (→ 255); soft edge does a linear 255 − alpha instead.
Frequently asked questions
How is this different from a plain colour invert?
It inverts the alpha channel only and leaves the three RGB channels untouched, so edge colours never get muddied; a colour invert flips RGB instead. The output is still a PNG named after the original plus -matting, and the result panel reports the number of "Pixels changed".
Should I use the threshold invert or "Keep soft edges (linear invert)"?
By default the tool thresholds: alpha ≥ threshold (1 by default) becomes 0, everything else becomes 255, leaving only fully transparent and fully opaque pixels — ideal for turning a white-background icon into a transparent-background one. With "Keep soft edges (linear invert)" it does alpha’ = 255 − alpha instead, which preserves feathered transitions.
Why did the whole image turn transparent, and how do I tune the threshold?
JPEG has no alpha channel, so every pixel has alpha 255 and the default threshold inverts them all to 0, making the whole image transparent — usually not what you want, so cut out a PNG with a real alpha channel first. When a cut-out has lots of semi-transparent fringes, raise the "Solid threshold" (0–255, for example 128) so pixels below it become transparent as well.
Keywords:invert alphapng mattingswap transparency