import cv2 import numpy import os # Make an array of 120,000 random bytes. randomByteArray = bytearray(os.urandom(120000)) flatNumpyArray = numpy.array(randomByteArray) # Convert the array to make a 400x300 grayscale image. grayImage = flatNumpyArray…