PNG Transparency and HTML5 Canvas Alpha Corruption
How premultiplied alpha inside HTML5 Canvas 2D silently alters semi-transparent RGB pixels and destroys A=0 data—and how KBLimit preserves straight-RGBA PNGs with 0 pixel diffs.
Frequently Asked Questions
Why does HTML5 Canvas turn transparent pixels black (0,0,0,0)?
HTML5 Canvas 2D stores pixels in premultiplied alpha format (R×A/255). When alpha is 0, all three color channels multiply to 0, permanently erasing hidden RGB values needed by texture filters and compositors.
How does KBLimit avoid PNG alpha corruption?
KBLimit bypasses HTML5 Canvas 2D for lossless PNG optimization and raw PNG cropping, decoding and encoding straight-RGBA buffers directly in a dedicated UPNG.js Web Worker.