• Canvas doesn’t throw errors if you paint outside the available space, but it uses memory • If you only need to convert with a canvas, don’t even add it to the DOM
BONUS TIPS:
• If you do a lot of array looping and changes, use a worker to avoid the interface to slow down. Canvas, however isn’t available in a worker! • Resizing a canvas is a cheap way to clear it • In animations, using a rgba(r,g,b,0.5) value for clearing the canvas gives a smooth ghosting effect • A black and white map is a great way to do background collision in games – just read the next few pixels in direction of the move and if they are white – boom