Wand solarize() function in Python
Last Updated :
08 May, 2020
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:
from wand.image import Image
with Image(filename = "koala.jpeg" ) as img:
img.solarize(threshold = 0.5 * img.quantum_range)
img.save(filename = "solpkoala.jpeg" )
|
Output :
Example 2:
Decreasing threshold value.
from wand.image import Image
with Image(filename = "koala.jpeg" ) as img:
img.solarize(threshold = 0.25 * img.quantum_range)
img.save(filename = "impkoala2.jpeg" )
|
Output:
Share your thoughts in the comments
Please Login to comment...