Pgmagick write() 方法Python
write()函数是 Pgmagick 库中的一个内置函数,用于写入中间图像。当前图像被写入指定的文件名,然后使用该图像继续处理。
Syntax:
Parameters: This function accepts single parameter which is mentioned above and defined below:
- filename: This parameter is used to specify the name of the processed image.
Return Value: This function returns the Pgmagick object.
示例 1:
write(filename)
输出:
示例 2:
from pgmagick import Image, DrawableCircle, DrawableText
from pgmagick import Geometry, Color
# draw the image of dimension 600 * 600
img = Image((600, 600), "gradient:# ffffff-# 12323e")
# invoke write function along with filename
img.write('1_a.png')
输出:
参考:
- http://www.graphicsmagick.org/Magick++/
在评论中写代码?请使用 ide.geeksforgeeks.org,生成链接并在此处分享链接。