converts canvas image data to a 2d array of booleans
array=img2array(imagedata,width,height)
array[x][y] //gives true or false
very useful for games where you need pixel perfect collision.
Reading an image every time you check for collision is slow. Using a 2d array makes it much faster, and has a very simple syntax (array[x][y]) .
Game engine using image to 2d array conversion: http://maloweb.com/snippets/terraindemo
(j*w+i)*4
->j*w+i>>2
?