Given a lookup table:
colors = [ [0,0,0],\
[0, 255, 0],\
[0, 0, 255],\
[255, 0, 0]]
And an index numpy matrix input 2x2:
a = np.array([[0,1],[1,1]])
How can I map a to a 2x2x3 matrix b, where b[i][j] = colors[a[i][j]]? I want to avoid using a for loop here.