Using a png is better for performance, but you need to wait until the image loads before you can start using it. So using window.onload is kind of pointless unless your images are in the DOM, which is how I load them sometimes.   <aside style="display:none"> <img id="img" src="some-image.png" /> </aside>   And you don't use beginPath() and fill() with drawImage(). Just draw the image.
    • Thanks
    • Like