I would like to know if it is possible to use canvases and javascript to scan an image for certain pixel colors and use them to make a map.
e.g:
find #ff0000
and set it to the number 1 on the map and set #000000
to 2 and so on to make a map like:
var map = [
[1,1,1,1,1],
[1,0,0,0,1],
[1,0,2,0,1],
[1,0,0,0,1],
[1,1,1,1,1]
];
So basically i want to know how to get the code to read an image and find the colors i want it to search for and then plot them out in a variable