Skip to content
Related Articles

Related Articles

Improve Article

Wand wave() function in Python

  • Last Updated : 08 May, 2020

wave() function creates a wave like structure from top and bottom of the image. Creates a ripple effect within the image. We can change wavelength as well as amplitude of the image using amplitude & wave_length parameters in wave() function.

Syntax :

wand.image.wave(amplitude, wave_legth)

Parameters :

ParameterInput TypeDescription
amplitudenumbers.IntegerSets amplitude of wave.
wavelengthnumbers.IntegerSets wavelength of wave.

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:
  
    # rippled image using vignette() function
    img.wave(amplitude = img.height / 32,
             wave_length = img.width / 4)
    img.save(filename ="wkoala2.jpeg")

Output :

Example 2: Increasing amplitude and decreasing wavelength.




# Import Image from wand.image module
from wand.image import Image
  
# Read image using Image function
with Image(filename ="koala.jpeg") as img:
  
    # rippled image using vignette() function
    img.wave(amplitude = img.height / 24,
             wave_length = img.width / 8)
    img.save(filename ="wkoala2.jpeg")

Output:

 Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.  

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course




My Personal Notes arrow_drop_up
Recommended Articles
Page :