Thursday, January 29, 2026
HomeLanguagesWand solarize() function in Python

Wand solarize() function in Python

Solarize Effect is the effect of tone reversal observed in cases of extreme overexposure of the photographic film in the camera. Most likely, the effect was first observed in scenery photographs including the sun (e.q. sol, sun). The sun, instead of being the whitest spot in the image, turned black or grey. solarize() function creates a “burned” effect on the image by replacing pixel values above a defined threshold with a negated value.

Syntax :

wand.image.solarize(amount, method)

Parameters :

Parameter Input Type Description
threshold numbers.Real between 0.0 and quantum_range./td>
channel basestring Optional color channel to target. See CHANNELS

Source Image:

Example 1:




# Import Image from wand.image module
from wand.image import Image
  
# Read image using Image function
with Image(filename ="koala.jpeg") as img:
  
    # solarized image using solarize() function
    img.solarize(threshold = 0.5 * img.quantum_range)
    img.save(filename ="solpkoala.jpeg")


Output :

Example 2:
Decreasing threshold value.




# Import Image from wand.image module
from wand.image import Image
  
# Read image using Image function
with Image(filename ="koala.jpeg") as img:
  
    # solarized image using solarize() function
    img.solarize(threshold = 0.25 * img.quantum_range)
    img.save(filename ="impkoala2.jpeg")


Output:

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

Most Popular

Dominic
32478 POSTS0 COMMENTS
Milvus
122 POSTS0 COMMENTS
Nango Kala
6849 POSTS0 COMMENTS
Nicole Veronica
11978 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12065 POSTS0 COMMENTS
Shaida Kate Naidoo
6986 POSTS0 COMMENTS
Ted Musemwa
7222 POSTS0 COMMENTS
Thapelo Manthata
6934 POSTS0 COMMENTS
Umr Jansen
6916 POSTS0 COMMENTS