array = np.random.uniform(size=(h, w, 3)) * 255 image = Image.fromarray(array) # w, h, 3
numpy array represented as image
array = np.random.uniform(size=(h, w, 3)) * 255 array = array[..., [2, 1, 0]] # rgb to bgr