Answer : This is simple with numpy and pylab . You can set the colormap to be whatever you like, here I use spectral. from pylab import imshow, show, get_cmap from numpy import random Z = random.random((50,50)) # Test data imshow(Z, cmap=get_cmap("Spectral"), interpolation='nearest') show() Your target image looks to have a grayscale colormap with a higher pixel density than 100x100: import pylab as plt import numpy as np Z = np.random.random((500,500)) # Test data plt.imshow(Z, cmap='gray', interpolation='nearest') plt.show() If you want to create an image file (and display it elsewhere, with or without Matplotlib), you could use NumPy and Pillow as follows: import numpy, from PIL import Image imarray = numpy.random.rand(100,100,3) * 255 im = Image.fromarray(imarray.astype('uint8')).convert('RGBA') im.save('result_image.png') The idea here is to create a numeric array, convert it to a RGB image, and sa