📜  Python – Wand 中的 spread() 方法

📅  最后修改于: 2022-05-13 01:55:21.336000             🧑  作者: Mango

Python – Wand 中的 spread() 方法

Spread用附近找到的随机像素值替换每个像素。 spread()函数用于对图像应用传播效果。可以通过定义半径来控制搜索新像素的区域大小。

源图像:

示例 1:

wand.image.spread(radius, method)

输出:

示例 2:在 spread() 方法中增加半径值。

# 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")

输出: