Solved by ptrblck in post #5 
              
              
                matplotlib uses the viridis colormap by default. 
In your first code snippet you were setting the color map to gray via: 
plt.imshow(test_img[0, 0], cmap='gray')