the polygon(xyfilloutlinemethod draws an arbitrary polygon the xy argument is list of tuplessuch as [(xy)(xy)]or integerssuch as [ ]representing the connecting points of the polygon' sides the last pair of coordinates will be automatically connected to the first pair the optional fill argument is the color of the inside of the polygonand the optional outline argument is the color of the polygon' outline drawing example enter the following into the interactive shellfrom pil import imageimagedraw im image new('rgba'( )'white'draw imagedraw draw(imu draw line([( )( )( )( )( )]fill='black' draw rectangle(( )fill='blue' draw ellipse(( )fill='red' draw polygon((( )( )( )( )( ))fill='brown' for in range( )draw line([( )( )]fill='green'im save('drawing png'after making an image object for white imagepassing it to imagedraw draw(to get an imagedraw objectand storing the imagedraw object in drawyou can call drawing methods on draw here we make thinblack outline at the edges of the image ua blue rectangle with its top-left corner at ( and bottom-right corner at ( va red ellipse defined by box from ( to ( wa brown polygon with five points xand pattern of green lines drawn with for loop the resulting drawing png file will look like figure - figure - the resulting drawing png image manipulating images