If each cube here represents a pixel, what is the fastest way to change its color so it looks exactly like the 2d image? Hi people, my goal here is to read the 2D images pixel intensity and transfer those values to the corresponding cubes I made in Blender. The image is 28px by 28px. 

My first question is if I already extracted the pixel values from the 2D image how can proceed and transfer its value to the cubes? For each cube, I should first create a texture correct? Then I can simply write a loop to copy over each corresponding value to replace the texture color? 

Second question would be can I set the color for each cube in blender to only gray scale? Its will be much easier that way. 

The third question is, is there something faster like grouping all texture values into a matrix, then set all the values to 1s, finally we just do a matrix multiplication to change all the values at once? If I read the image with Pillow and numpy I can get an array back so I don't have to loop 28x28 times.

Can someone give me some advice? I am currently using Blender 2.8 and would like to run this in realtime with Eevee.

For a better idea on what I am trying to do in Blender please check out this video.

https://youtu.be/3JQ3hYko51Y?t=15 

I am basically going to do the same thing but visualizing a different network structure.
This is the fastest way:
1. add a cube
2. add two array modifiers to x and y axis and apply them
3. go to edit mode, use orthagonic view (num5), hit "u" and select "projection from view (boundary)"
4. hit "p" select "by loose parts"
5. go back to object mode, select everything and hit ctrl+shift+alt+c and select "origin to center of mass"