#n x m x 3 is to be converted to 3 x (n*m), img.transpose(2,0,1).reshape(3,-1)
img.transpose(2,0,1).reshape(3,-1)