When the array passed to imshow is 3-dimensional and has floating-point dtype,
plt.show() calls this piece of code:
if x.ndim == 3:
...
if xx.dtype.kind == 'f':
if bytes:
xx = (xx * 255).astype(np.uint8)
return xx
So the values in colored are being multiplied by 255 and then astyped to np.uint8.
This happens before the values are normalized to the interval [0, 1]. You can verify this by putting a print statement in your matplotlib/cm.py file:
if x.ndim == 3:
...
if xx.dtype.kind == 'f':
if bytes:
print(xx.max())
xx = (xx * 255).astype(np.uint8)
return xx
and running this script:
import numpy as np
import matplotlib.pyplot as plt
maxval = np.iinfo('uint16').max
uint16_image = np.linspace(0, maxval, (16**2)).astype('uint16')
uint16_image = uint16_image.reshape(16, 16)
colored = np.empty(uint16_image.shape + (3,), dtype=float)
colored[:, :, 0] = uint16_image
colored[:, :, 1] = uint16_image
colored[:, :, 2] = uint16_image
fig, ax = plt.subplots(nrows=2)
ax[0].imshow(uint16_image)
ax[1].imshow(colored)
plt.show()
which prints
65535.0
65535.0
and displays

The moral of the story is that if you pass a 3D float array to plt.imshow, the values must be between 0 and 1 (or NaN) or else you will likely get (graphical) mojibake.
plt.imshow(colored, cmap='gray'). Numbers look right! So, something's wrong with plot function...coloredand it should be array offloat. When I'm plottingimage(array ofuint16) by the same way, it works!imshow(colored[:,:,0])? When creating the 3d array, are you normalizing the values.imshowsays the values should be in the 0.0 to 1.0 range.imshowcan be used with 3-color images with values 0..255...