Wand polygon() function in Python Last Updated : 10 May, 2020 Comments Improve Suggest changes Like Article Like Report polygon() 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 : Parameter Input Type Description points list list of x, y tuples. Example #1 Python3 1== from wand.image import Image from wand.drawing import Drawing from 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: Python3 1== from wand.image import Image from wand.drawing import Drawing from 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 : Comment More infoAdvertise with us Next Article Wand polygon() function in Python R RahulSabharwal Follow Improve Article Tags : Python Python-wand Practice Tags : python Similar Reads Wand polyline() function in Python polyline() is another drawing function present in wand.drawing module of Wand. polyline() is similar to polygon() function the only difference is that, it will not close the stroke line b/w first and last point. Similar to polygon() it also takes a list of point tuples as an argument. Syntax : wand. 1 min read Wand point() function in Python point() is another drawing function and simplest of all. point() function basically draw a point on a particular point on an image. It simply takes two x, y arguments for the point coordinate. Syntax : wand.drawing.point(x, y) Parameters: ParameterInput TypeDescriptionxnumbers.Realx coordinate of po 1 min read Wand line() function in Python line() is another drawing function present in wand.drawing module. As the name implies line() function is used to draw a line in the image. line() function only need two arguments that are start and end point of the line that we want to draw. Syntax : wand.drawing.line(start, end) Parameters : Param 2 min read Wand implode() function - Python The implode() function is an inbuilt function in the Python Wand ImageMagick library which is used to create a âimplodingâ effect by pulling pixels towards the center of the image. Syntax: implode(amount, method) Parameters: This function accepts two parameters as mentioned above and defined below: 2 min read Wand oil_paint() function - Python The oil_paint() function is an inbuilt function in the Python Wand ImageMagick library which is used to simulate an oil painting by replace each pixel with most frequent surrounding color. Syntax: oil_paint(radius, sigma) Parameters: This function accepts three parameters as mentioned above and defi 2 min read Wand noise() function - Python The noise() function is an inbuilt function in the Python Wand ImageMagick library which is used to add noise to the image. Syntax: noise(noise_type, attenuate, channel) Parameters: This function accepts three parameters as mentioned above and defined below: noise_type: This parameter is used to sto 2 min read Wand arc() function in Python arc() is a function present in wand.drawing module. arc() function draws an arc in the image. Youâll need to define three pairs of (x, y) coordinates. First & second pair of coordinates will be the minimum bounding rectangle, and the last pair define the starting & ending degree. Syntax : wa 2 min read Wand mode() function - Python The mode() function is an inbuilt function in the Python Wand ImageMagick library which is used to replace each pixel with the mathematical mode of the neighboring colors. Syntax: mode(width, height) Parameters: This function accepts two parameters as mentioned above and defined below: width: This p 2 min read Wand - sketch() function in Python Sketch is another artistic special effect present in Wand library in python. sketch() function generates a pencil sketched image in output.For best results, radius value should be larger than sigma. Syntax : Python3 wand.image.sketch( radius, sigma, angle) # radius should always be greater than sig 1 min read Wand function() function in Python function() function is similar to evaluate function. In function() function pixel channels can be manipulated by applies a multi-argument function to pixel channels. Following are the list of FUNCTION_TYPES in Wand: 'undefined''arcsin''arctan''polynomial''sinusoid' Syntax : wand.image.function(funct 1 min read Like