Wand function() function in Python (original) (raw)
Last Updated : 27 Feb, 2023
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(function, arguments, channel)
Parameters :
Parameter Input Type Description function collections.abc.Sequence a sequence of doubles to apply against function arguments numbers.Real Number to calculate with operator channel basestring Optional channel to apply operation on.
Example 1:
Source Image:
Python3
from
wand.image
import
Image
frequency
=
3
phase_shift
=
-
90
amplitude
=
0.2
bias
=
0.7
with Image(filename
=
"koala.jpeg"
) as img:
`` img.function(
'sinusoid'
, [frequency, phase_shift, amplitude, bias])
`` img.save(filename
=
"kl-functioned.jpeg"
)
Output :
Example 2:
Source Image:
Python3
from
wand.image
import
Image
frequency
=
3
phase_shift
=
-
90
amplitude
=
0.2
bias
=
0.7
with Image(filename
=
"road.jpeg"
) as img:
`` img.function(
'polynomial'
, [frequency, phase_shift, amplitude, bias])
`` img.save(filename
=
"rd-functioned.jpeg"
)
Output :
Similar Reads
- 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 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 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 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 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
- 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 Drawing() function in Python Another module for wand is wand.drawing. This module provides us with some very basic drawing functions. wand.drawing.Drawing object buffers instructions for drawing shapes into images, and then it can draw these shapes into zero or more images. Syntax : with Drawing() as draw: Note: In the above sy 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