Thursday, September 4, 2025
HomeLanguagesWand tint() function in Python

Wand tint() function in Python

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




# Import Image from wand.image module
from wand.image import Image
 
# Read image using Image function
with Image(filename ="koala.jpeg") as img:
 
    # tinted image using tint() function
    img.tint(color ="yellow", alpha ="rgb(40 %, 60 %, 80 %)")
    img.save(filename ="tintkoala.jpeg")


Output:

  

Example 2: Increasing amount value 

Python3




# Import Image from wand.image module
from wand.image import Image
 
# Read image using Image function
with Image(filename ="koala.jpeg") as img:
 
    # tinted image using tint() function
    img.tint(color ="green", alpha ="rgb(10 %, 20 %, 40 %)")
    img.save(filename ="tint2.jpeg")


Output:

 

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32260 POSTS0 COMMENTS
Milvus
81 POSTS0 COMMENTS
Nango Kala
6626 POSTS0 COMMENTS
Nicole Veronica
11795 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11855 POSTS0 COMMENTS
Shaida Kate Naidoo
6747 POSTS0 COMMENTS
Ted Musemwa
7023 POSTS0 COMMENTS
Thapelo Manthata
6695 POSTS0 COMMENTS
Umr Jansen
6714 POSTS0 COMMENTS