魔杖阴影()函数- Python
shadow()函数是Python Wand ImageMagick 库中的一个内置函数,用于生成图像阴影。
Syntax:
Parameters: This function accepts four parameters as mentioned above and defined below:
- alpha: This parameter stores the ratio of the transparency.
- sigma: This parameter stores the sigma level of the sharpen image.
- x: This parameter stores the x-offset.
- y: This parameter stores the y-offset.
Return Value: This function returns the Wand ImageMagick object.
原图:
示例 1:
shadow(alpha, sigma, x, y)
输出:
示例 2:
# Import library from Image
from wand.image import Image
# Import the image
with Image(filename ='../geeksforgeeks.png') as image:
# Clone the image in order to process
with image.clone() as shadow:
# Invoke shadow function
shadow.shadow(0.8, 0.2, 10, 40)
# Save the image
shadow.save(filename ='shadow1.jpg')
输出:
在评论中写代码?请使用 ide.geeksforgeeks.org,生成链接并在此处分享链接。