Saturday, October 25, 2025
HomeLanguagesPython – shade() function in Wand

Python – shade() function in Wand

shade() function generates a 3d kind of image or creates a 3d effect by simulating a light from an elevated angle. azimuth parameter is used to control the X and Y angle and elevation parameter is used to control the z angle of the image. We can also get final image in grayscale by putting gray parameter as true.
 

Syntax : 
 

wand.image.shade(gray, azimuth, elevation);

Parameters : 

 

Parameter Input Type Description
gray boolean Isolate the effect on pixel intensity. Default is False.
azimuth numbers.real Angle from x-axis.
elevation number.Real Amount of pixels from the z-axis.

 

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:
 
    # generating shaded image using shade() function.
    img.shade(gray = True,
              azimuth = 286.0,
              elevation = 45.0)
 
    img.save(filename ="shadekoala.jpeg")


Output: 
 

Example 2: setting gray as False, increasing azimuth and elevation value.
 

Python3




# import Image from wand.image module
 
from wand.image import Image
 
with Image(filename ="koala.jpeg") as img:
    # generating shaded image using shade() function.
    img.shade(gray = True,
              azimuth = 298.0,
              elevation = 70.0)
 
    img.save(filename ="shadekoala_2.jpeg")


Output: 
 

 

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

Most Popular

Dominic
32361 POSTS0 COMMENTS
Milvus
88 POSTS0 COMMENTS
Nango Kala
6728 POSTS0 COMMENTS
Nicole Veronica
11892 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11954 POSTS0 COMMENTS
Shaida Kate Naidoo
6852 POSTS0 COMMENTS
Ted Musemwa
7113 POSTS0 COMMENTS
Thapelo Manthata
6805 POSTS0 COMMENTS
Umr Jansen
6801 POSTS0 COMMENTS