Thursday, September 4, 2025
HomeLanguagesPython – spread()method in Wand

Python – spread()method in Wand

Spread replaces each pixel with the random pixel value found nearby. spread() function is used to apply Spread effect to the image. The size of the area to search for a new pixel can be controlled by defining a radius.

Syntax :

wand.image.spread(radius, method)

Parameters :

Parameter Input Type Description
radius numbers.Real Distance a pixel can be displaced from source. Default value is 0.0, which will allow ImageMagick to auto select a radius.
method basestring Interpolation method. Only available with ImageMagick-7. Optional parameter.

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:
  
    # Generate spread image using spread() function
    img.spread(radius = 8.0)
    img.save(filename ="spreadkoala.jpg")


Output:

Example 2: Increase radius value in spread() method.




# Import Image from wand.image module
from wand.image import Image
  
# Read image using Image() function
with Image(filename ="koala.jpeg") as img:
  
    # Generate spread image using spread() function
    img.spread(radius = 16.0)
    img.save(filename ="spreadkoala2.jpg")


Output:

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

Most Popular

Dominic
32261 POSTS0 COMMENTS
Milvus
81 POSTS0 COMMENTS
Nango Kala
6626 POSTS0 COMMENTS
Nicole Veronica
11795 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11855 POSTS0 COMMENTS
Shaida Kate Naidoo
6747 POSTS0 COMMENTS
Ted Musemwa
7023 POSTS0 COMMENTS
Thapelo Manthata
6695 POSTS0 COMMENTS
Umr Jansen
6714 POSTS0 COMMENTS