'''Generate a color static screen image''' # import the Pillow Image type from PIL import Image # import the random library -- need it for static import random def static( w, h ) : ''' Return a color static image with dimensions w by h ''' # create a blank canvas on which to paint our image im = Image.new( 'RGB', ( w, h ) ) # consider every spot (pixel) on the new image for y in range( 0, h ) : for x in range( 0, w ) : # got coordinate of interest coord = ( x, y ) # generate the color for the pixel # set pixel color at coordinate of interest return im if ( __name__ == '__main__' ) : noise = static( 300, 400 ) noise.show()