fximage
This commit is contained in:
15
konabot/plugins/fx_process/fx_handle.py
Normal file
15
konabot/plugins/fx_process/fx_handle.py
Normal file
@ -0,0 +1,15 @@
|
||||
from PIL import Image, ImageFilter
|
||||
|
||||
class ImageFilterUtils:
|
||||
@staticmethod
|
||||
def apply_blur(image: Image.Image, radius: float = 5) -> Image.Image:
|
||||
"""对图像应用模糊效果
|
||||
|
||||
参数:
|
||||
image: 要处理的Pillow图像对象
|
||||
radius: 模糊半径,值越大模糊效果越明显
|
||||
|
||||
返回:
|
||||
处理后的Pillow图像对象
|
||||
"""
|
||||
return image.filter(ImageFilter.GaussianBlur(radius))
|
||||
Reference in New Issue
Block a user