Wand tint() function in Python
Last Updated :
27 Mar, 2023
tint() function colorizes midtones of an image by blending the given color. The alpha parameter controls how the blend is effected between color channels. However, this can be tricky to use, so when in doubt, use a alpha=”gray(50)” argument.
Syntax :
wand.image.tint(color, alpha)
Parameters :
Parameter |
Input Type |
Description |
color |
Color |
Color to calculate midtone. |
alpha |
Color |
Determine how to blend. |
Source Image:
Example 1:
Python3
from wand.image import Image
with Image(filename = "koala.jpeg") as img:
img.tint(color = "yellow", alpha = "rgb( 40 % , 60 % , 80 % )")
img.save(filename = "tintkoala.jpeg")
|
Output:
Example 2: Increasing amount value
Python3
from wand.image import Image
with Image(filename = "koala.jpeg") as img:
img.tint(color = "green", alpha = "rgb( 10 % , 20 % , 40 % )")
img.save(filename = "tint2.jpeg")
|
Output:
Share your thoughts in the comments
Please Login to comment...