Thursday, December 11, 2025
HomeLanguagesWand swirl() function in Python

Wand swirl() function in Python

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:

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32444 POSTS0 COMMENTS
Milvus
105 POSTS0 COMMENTS
Nango Kala
6813 POSTS0 COMMENTS
Nicole Veronica
11950 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12026 POSTS0 COMMENTS
Shaida Kate Naidoo
6944 POSTS0 COMMENTS
Ted Musemwa
7197 POSTS0 COMMENTS
Thapelo Manthata
6889 POSTS0 COMMENTS
Umr Jansen
6881 POSTS0 COMMENTS