Wand path_curve() function in Python (original) (raw)
Last Updated : 20 Jun, 2021
path_curve() is a function specially introduced for paths. path_curve() draws a cubic bezier curve from the destination point of the Image to a particular point (x, y) with the help of control points.
Syntax :
wand.drawing.path_curve(to, controls, smooth, relative)
Parameters:
Parameter Input Type Description to sequence or (numbers.Real, numbers.Real) pair which represents coordinates to drawn to. controls collections.abc.sequence or (numbers.Real, numbers.Real) coordinate to used to influence curve smooth bool assume last defined control coordinate relative bool treat given coordinates as relative to current point.
Example #1:
Python3
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'
)
`` draw.path_start()
`` draw.path_move(to
=
(
10
,
100
))
`` draw.path_curve(to
=
(
80
,
0
),
`` controls
=
[(
20
,
-
80
), (
60
,
-
80
)],
`` relative
=
True
)
`` draw.path_curve(to
=
(
80
,
0
),
`` controls
=
(
60
,
80
),
`` smooth
=
True
,
`` relative
=
True
)
`` draw.path_finish()
`` with Image(width
=
200
, height
=
200
, background
=
Color(
'lightgreen'
)) as image:
`` draw(image)
`` image.save(filename
=
"pathcurve.png"
)
Output :
Similar Reads
- Wand path_close() function in Python path_close() is another function included in wand for paths. The main aim of this function is to join the last destination point to the first point in the path. It simply adds a path element to the current path which closes the current subpath by drawing a straight line from the current point to the 1 min read
- Wand path_line() function in Python path_line() is a function specially introduced for paths. path_line() draws a line from a destination point to the point we want the line we end to. It takes only end point as argument. Syntax : wand.drawing.path_line(to, relative) Parameters: ParameterInput TypeDescriptiontosequence or (numbers.Rea 1 min read
- Wand circle() function in Python 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 : ParameterInput TypeDescriptionorigin(collections.abc. 2 min read
- Wand path_finish() function in Python Another vital function for paths in wand is python_finish(). As python_start() initiate the path and it is very important to terminate the path also, the path_finish() function handles the termination of the current path. Syntax: wand.drawing.path_finish() Example 1: from wand.image import Image fro 1 min read
- Wand path_move() function in Python path_move() is another function introduced in wand for paths. The main aim of path_move() function is to set new starting point for a new sub_path. Given to parameter can be relative, or absolute, by setting the relative flag. Syntax : wand.drawing.path_move(to, relative) Parameters: Parameter Input 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 path_elliptic_arc() function in Python path_elliptic_arc() is a function specially introduced for paths. path_elliptic_arc() draws an elliptical arc from current point to a particular point we want the arc to drawn to. Let's see parameters needed for this function. Syntax : wand.drawing.path_elliptic_arc(to, radius, rotation, large_arc, 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 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 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