PNG Transparency on Canvas

Rigil picture Rigil · Jan 13, 2011 · Viewed 11.2k times · Source

Does canvas support PNG alpha? Im having some issues with a few PNGs that I've added to the canvas. The edges of the images are black and jagged as if no alpha channel exists or is being recognized.

Answer

oberhamsi picture oberhamsi · Jan 13, 2011

If you put a 24-bit PNG with alpha on the canvas it understands it.

https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Canvas_tutorial/Using_images

Maybe your PNGs are not clean, i.e. have non-transparent regions at the borders?