Open In App

Wand swirl() function in Python

Last Updated : 08 May, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

swirl() generates a kind of distorted image in which a visual whirlpool effect by rotating pixels around the center of the image.implode() generates a kind of distorted image in which pull effect is noticed into the middle of the image.The amount argument controls the range of pixels to pull towards the center.

Syntax :

wand.image.swirl(degree, method)

Parameters :

Parameter Input Type Description
degree numbers.Real Defines the amount of pixels to be effected. Value between -360.0 and 360.0.
method basestring Controls interpolation of the effected pixels. Only available for ImageMagick-7.

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:
  
    # swirl image using swirl() function
    img.swirl(degree =-90)
    img.save(filename ="wkoala.jpeg")


Output:

Example 2:
Changing degree value




# Import Image from wand.image module
from wand.image import Image
  
# Read image using Image function
with Image(filename ="koala.jpeg") as img:
    # swirl image using swirl() function
    img.swirl(degree = 100)
    img.save(filename ="wkoala2.jpeg")


Output:


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads