Wand polygon() function in PythonReadDiscussCoursesPracticeImprove Article ImproveSave Article SaveLike Article Likepolygon() function is another drawing function introduced in wand.drawing module. We can draw complex shapes using polygon() function. It takes a list of points in polygons as argument. Stroke line will automatically close between first & last point.Syntax : wand.drawing.polygon(points) Parameters :ParameterInput TypeDescriptionpointslistlist of x, y tuples.Example #1from wand.image import Imagefrom wand.drawing import Drawingfrom wand.color import Color with Drawing() as draw: draw.stroke_width = 2 draw.stroke_color = Color('black') draw.fill_color = Color('white') # points list for polygon points = [(25, 25), (175, 100), (25, 175)] # draw polygon using polygon() function draw.polygon(points) with Image(width = 200, height = 200, background = Color('lightgreen')) as image: draw(image) image.save(filename = "polygon.png")Output :Example #2:from wand.image import Imagefrom wand.drawing import Drawingfrom wand.color import Color with Drawing() as draw: draw.stroke_width = 2 draw.stroke_color = Color('black') draw.fill_color = Color('white') # points list for polygon points = [(50, 50), (150, 50), (175, 150), (25, 150)] # draw polygon using polygon() function draw.polygon(points) with Image(width = 200, height = 200, background = Color('lightgreen')) as image: draw(image) image.save(filename = "polygon2.png")Output :Last Updated : 10 May, 2020Like Article Save Article Please Login to comment...Similar ReadsWand selective_blur() function in Wand pythonWand function() function in PythonWand image - Baseimage.kuwahara() function in PythonWand image.edge function in PythonWand gaussian_blur() function in PythonWand transform() function in PythonWand crop() function in PythonWand rotational_blur() function in PythonWand - blur() function in PythonPython - Image() function in WandRelated TutorialsOpenAI Python API - Complete GuidePandas AI: The Generative AI Python LibraryPython for Kids - Fun Tutorial to Learn Python ProgrammingData Analysis TutorialFlask Tutorial LikePreviousWand push() and pop() in PythonNext Wand polyline() function in PythonArticle Contributed By :RRahulSabharwalRahulSabharwal FollowVote for difficultyEasy Normal Medium Hard ExpertArticle Tags :Python-wandPythonPractice Tags :pythonReport Issue