'''Use Pillow for image representation''' # import the Pillow Image type from PIL import Image # create a d by d canvas on which to paint our image # If you want to draw on a picture, need to get a different version of it # Consider the picture to be a canvas that you paint on top of d = 300 c1 = 'red' # a string that Python recognizes in its color library c2 = 'thistle' c3 = (204, 204, 255 ) #called a tuple in Python; indicates the r g b value here c4 = '#0892D0' # hexadecimal string; digits are 0-9, A-F image0 = Image.new( 'RGB', ( d, d ) ) # If you want a new canvas, need to give it the dimensions you want (w, h) image1 = Image.new( 'RGB', ( 200, 50 ), c1 ) # By default, background is black; this line indicates background as red image2 = Image.new( 'RGB', ( d, d ), c2 ) # RGB string in this line tells that you represent this image in red, # green, and blue; in this class, it will ALWAYS be RGB image3 = Image.new( 'RGB', ( d, d ), c3 ) image4 = Image.new( 'RGB', ( d, d ), c4 ) image0.show() ; input( 'Enter when ready: ' ) image1.show() ; input( 'Enter when ready: ' ) image2.show() ; input( 'Enter when ready: ' ) image3.show() ; input( 'Enter when ready: ' ) image4.show()