'''Use Pillow for image representation''' # import the Pillow Image type from PIL import Image # import url for image acquisition import url # create a d by d canvas on which to paint our image d = 300 c1 = 'red' c2 = 'thistle' c3 = (204, 204, 255 ) c4 = '#0892D0' image0 = Image.new( 'RGB', ( d, d ) ) image1 = Image.new( 'RGB', ( d, d ), c1 ) image2 = Image.new( 'RGB', ( d, d ), c2 ) 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() image0.save( 'black.png' ) image1.save( 'red.png' ) image2.save( 'thistle.png' ) image3.save( 'dark-lavender.png' ) image4.save( 'royal-blue.png' )