Thursday, July 11, 2024
HomeLanguagesPythonWand image – Baseimage.kuwahara() function in Python

Wand image – Baseimage.kuwahara() function in Python

Kuwahara is one of the most famous and important effect in image processing. kuwahara() function is used to add kuwahara effect to the image. The kuwahara() method applies a smoothing filter to reduce noise in an image, but also preserves edges. kuwahara() function takes only two parameters.

Syntax :

wand.image.kuwahara(radius=radius, sigma= std.deviation)

Parameters :

Parameter Input Type Description
radius numbers.Real Size of the filter aperture.
sigma numbers.Real Standard deviation of Gaussian filter.

Image Used :

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:
  
    # apply kuwahara effect using kuwahara() function
    img.kuwahara(radius = 2, sigma = 1.5)
    img.save(filename ="koalakuwahara.jpg")


Output:

Example #2: Increasing radius and sigma




# import Image from wand.image module
from wand.image import Image
  
# read image using Image() function
with Image(filename ="koala.jpeg") as img:
  
    # apply kuwahara effect using kuwahara() function
    img.kuwahara(radius = 4, sigma = 3)
    img.save(filename ="koalakuwahara.jpg")


Output:

Last Updated :
22 Apr, 2020
Like Article
Save Article

<!–

–>

Similar Reads
Related Tutorials
Ted Musemwa
As a software developer I’m interested in the intersection of computational thinking and design thinking when solving human problems. As a professional I am guided by the principles of experiential learning; experience, reflect, conceptualise and experiment.
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments