Wand circle() function in Python (original) (raw)
Last Updated : 25 Apr, 2025
The circle() function is another Drawing function in Wand. This method is used to draw a circle in the image. It requires only two arguments that are origin and perimeter of the circle.
Syntax: wand.drawing.circle(origin, perimeter)
Parameters :
Parameter Input Type Description origin (collections.abc.Sequence)or(Real, numbers.Real) pair which represents origin x and y of circle. perimeter (collections.abc.Sequence)or(Real, numbers.Real) pair which represents perimeter x and y of circle
Example #1:
Python3
from
wand.image
import
Image
from
wand.drawing
import
Drawing
from
wand.color
import
Color
with Drawing() as draw:
`` draw.stroke_color
=
Color(
'black'
)
`` draw.stroke_width
=
1
`` draw.fill_color
=
Color(
'white'
)
`` origin
=
(
100
,
100
)
`` perimeter
=
(
50
,
50
)
`` draw.circle(origin, perimeter)
`` with Image(width
=
200
,
`` height
=
200
,
`` background
=
Color(
'green'
)) as img:
`` draw.draw(img)
`` img.save(filename
=
'circle.png'
)
Output:
Example #2:
Input Image:
Python3
from
wand.image
import
Image
from
wand.drawing
import
Drawing
from
wand.color
import
Color
with Drawing() as draw:
`` origin
=
(
100
,
100
)
`` perimeter
=
(
50
,
50
)
`` draw.stroke_color
=
Color(
'black'
)
`` draw.stroke_width
=
1
`` draw.fill_color
=
Color(
'white'
)
`` draw.circle(origin, perimeter)
`` with Image(filename
=
"gog.png") as img:
`` draw.draw(img)
`` img.save(filename
=
'circle2.png'
)
Output:
Similar Reads
- 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 crop() function in Python Cropping an image refers to select an area of image and discard everything outside the cropped area. Crop tool is an important tool as it allows us to get the only relevant part of an image. Also sometimes something unwanted may be contained in the image and that can be discarded from the image usin 3 min read
- Wand color() function in Python color() function draws a color on the image using current fill color, starting at specified position & method. Uses same arguments as color() method. Following are PAINT_METHOD_TYPES. 'point' alters a single pixel.'replace' swaps on color for another. Threshold is influenced by fuzz.'floodfill' 2 min read
- Wand bezier() function in Python The bezier() is another Drawing function in Wand. This method is used to draw a bezier curve. It requires four points to determine a bezier curve. Extreme points define the start and end of the curve while in between two points are used to control the curve. Syntax: wand.drawing.bezier(points) Param 2 min read
- Wand flip() function in Python In this article we will learn what is flip() function. Basically this function returns a flipped image. Flip effect flips an image upside-down or creates an vertical reflection of image. No arguments are needed in this function. Syntax : wand.image.flip()Parameters : No Parameters in flip() function 1 min read
- Wand - blur() function in Python Blurring Image means making an image fuzzy or hazy. A blur image is indefinite and it is unable to see an image clearly. Blur is of many types, like - Adaptive blur, Gaussian blur, Selective Blur etc. In order to blur an image we use blur() function. blur() function takes three arguments. Example : 2 min read
- Wand flop() function in Python In this article we will learn what is flop() function. Basically this function returns a flipped image. Flop effect flops an image upside-down or creates an vertical reflection of image. No arguments are needed in this function. Syntax : wand.image.flop()Parameters : No Parameters in flop() function 1 min read
- Wand composite() function in Python The composite() function renders an image on top of the drawing subject image using COMPOSITE_OPERATORS. A compositing image must be given with a destination top, left, width, and height values. Syntax: wand.drawing.composite(image, left, top, operator, arguments, gravity) Parameters : Parameter Inp 2 min read
- Wand enhance() function in Python Similar to despeckle() function this function also reduces noise of the image. enhance() function return an image with reduced noise of an image by applying an auto-filter. Syntax : wand.image.enhance() Parameters : No parameters in enhance() function Source Image: Example 1: C/C++ Code # Import Ima 1 min read
- Wand ellipse() function in Python ellipse() function is used to draw an ellipse on the image. Just similar to drawing circle the ellipse() function requires two pairs of point that is, origin and a pair of (x, y) radius of the ellipse. To draw a partial ellipse, provide a pair of starting & ending degrees as the third parameter. 2 min read