Assume I have a very simple file with a matrix like
00011000
00022000
00011000
12100121
12100121
00011000
00022000
00011000
I want to import it to TikZ and transform it to a picture, where each cell in the matrix is interpreted as a small square with a color, defined by the content of the cell (e.g. 0 white, 1 gray, 2 black or so). I think that there is a quite simple solution for it. Probably I do not need a complete solution, some hints should be sufficient. Thanks in advance!