I'm trying to visualize a 11-bit TIFF image using matplotlib. To do it, I load the image using tifffile to obtain a 3D numpy array. Next, I have to down-sample the image because the array contains values beyond the range [0, 255]. Here is my code:
import tifffile as ti from scipy.misc import bytescale x_3band = ti.imread(three_band_file_path) # transpose to make the shape [M, N, 3] X = np.transpose(x_3band, (1,2,0)) X = bytescale(X) plt.imshow(X) plt.show()
The problem is that the visualized picture is different with the picture visualized in QGIS (see the picture, the left picture is with matplotlib).