Pgmagick charcoal() 方法 – Python
charcoal()函数是 Pgmagick 库中的一个内置函数,用于向图像添加炭过滤器。该函数在成功时返回真值。
Syntax:
Parameters: This function accepts single parameters as mentioned above and described below:
- factor: This parameter stores the value of the charcoal factor which is to be apply on the image.
Return Value: This function returns the Pgmagick object with image added.
输入图像:
示例 1:
charcoal(factor)
输出:
示例 2:
from pgmagick import Image, DrawableCircle, DrawableText
from pgmagick import Geometry, Color
# draw the image of dimension 600 * 600
img = Image('input.png')
# invoke charcoal function with factor 8
img.charcoal(8)
# invoke write function along with filename
img.write('2_a.png')
输出:
在评论中写代码?请使用 ide.geeksforgeeks.org,生成链接并在此处分享链接。