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
what if have real image data and want to convert it to a 2d array but fill it with data, not booleans?