import numpy as np from matplotlib import pylab as plt A = np.fromfile(filename, dtype='int16', sep="") A = A.reshape([1024, 1024]) plt.imshow(A)