Wand modulate() function Python (original) (raw)
Last Updated : 13 Dec, 2022
The modulate() function is an inbuilt function in the Python Wand ImageMagick library which is used to changes the brightness, saturation and hue of the image.
Syntax:
modulate(brightness, saturation, hue)
Parameters: This function accepts three parameters as mentioned above and defined below:
- brightness: This parameter is used to store the brightness percentage.
- saturation: This parameter is used to store the saturation percentage.
- hue: This parameter is used to store the hue percentage.
Return Value: This function returns the Wand ImageMagick object.
Original Image:
Example 1:
Python3
from
wand.image
import
Image
with Image(filename
=
'../geeksforgeeks.png'
) as image:
`` with image.clone() as modulate:
`` modulate.save(filename
=
'modulate1.jpg'
)
Output:
Example 2:
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'
)
`` draw.circle((
200
,
200
),
`` (
100
,
100
))
`` draw.font
=
'../Helvetica.ttf'
`` draw.font_size
=
30
`` with Image(width
=
400
, height
=
400
, background
=
Color(
'# 45ff33'
)) as pic:
`` draw.text(
int
(pic.width
/
3
),
int
(pic.height
/
2
),
'GeeksForGeeks !'
)
`` draw(pic)
`` pic.save(filename
=
'modulate2.jpg'
)
Output:
Similar Reads
- 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 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 implode() function - Python implode() generates a kind of distorted image in which pull effect is noticed into the middle of the image. The amount argument controls the range of pixels to pull towards the center. Syntax : wand.image.implode(amount, method) Parameters : ParameterInput TypeDescriptionamountnumbers.RealNormalized 1 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
- Python - Image() function in Wand In this specific article we will learn how to read our image through Python wand module. To read image in Wand we use Image() function. To manipulate an image first of all we need to read image in Python. Parameters : Parameter Input Type Description image Image make exact copy of image blob bytes o 2 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 magnify() function - Python The magnify() function is an inbuilt function in the Python Wand ImageMagick library which is used to double an image in size. It magnifies the image by factor 2. Syntax: flop() Parameters: This function does not accept any parameter.Return Value: This function returns the Wand ImageMagick object. O 2 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 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