Pgmagick implode() 方法 – Python
implode()函数是 Pgmagick 库中的一个内置函数,用于对中心周围的图像像素进行内爆。该函数在成功时返回真值。
Syntax:
Parameters: This function accepts single parameter as mentioned above and described below:
- factor: This parameter is used to specify the factor by which the image need to be implode image pixels about the center.
Return Value: This function returns the Pgmagick object with image added.
输入图像:
示例 1:
implode(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 implode() function
img.implode(4)
# invoke write function along with filename
img.write('2_a.png')
输出:
在评论中写代码?请使用 ide.geeksforgeeks.org,生成链接并在此处分享链接。