Search code examples
javascripthtmlcanvastransparency

How to draw transparent image with html5 canvas element


I am targeting google chrome. Is it possible to draw transparent images on a canvas? By transparent I mean the drawing the entire image at something like 50% opacity.


Solution

  • The canvas element has a global alpha attribute that lets you apply partial transparency to anything you draw.