Open In App

Wand wavelet_denoise() function in Python

Last Updated : 09 Mar, 2023
Comments
Improve
Suggest changes
Like Article
Like
Report

This method is same as removing noise from image using soften() function. But this method removes noise by applying a wavelet transform which is more convenient and effective. The threshold argument should be a value between 0.0 & quantum_range,
 

Syntax : 
 

wand.image.wavelet_denoise(threshold, softness)


Parameters : 
 

ParameterInput TypeDescription
thresholdnumbers.Realvalue between 0.0 & quantum_range
softnessnumbers.Realapply softness to image


 


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:

    # denoise image using wavelet_denoise() function
    img.wavelet_denoise(threshold = 0.05 * img.quantum_range,
                        softness = 0.0)
    img.save(filename ="vkoala.jpeg")

Output: 
 


Example 2: Increasing threshold 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:

    # denoise image using wavelet_denoise() function
    img.wavelet_denoise(threshold = 0.065 * img.quantum_range,
                        softness = 0.00)
    img.save(filename ="vkoala2.jpeg")

Output: 
 


 


Article Tags :
Practice Tags :

Explore