如何使用python的Pillow模块新建图像

时间:2024-10-12 03:34:11

1、第一步,点击键盘 win+r,打开运行窗口;在窗口中输入“cmd",点击确定,打开windows命令行窗口。

如何使用python的Pillow模块新建图像如何使用python的Pillow模块新建图像如何使用python的Pillow模块新建图像

2、第二步,在cmd命令行窗口中输入"python",进入python交互窗口。

如何使用python的Pillow模块新建图像

3、第三步,导入Pillow的Image模块。

如何使用python的Pillow模块新建图像

4、第四步,使用Image.new()方法新建一张紫色的图片,它的像素大小分别为宽200,长200。

如何使用python的Pillow模块新建图像

5、第五步,使用Image.save()方法,将此图片保存在D盘的python文件夹下。

如何使用python的Pillow模块新建图像

6、第六步,查看此图片是否保存。

如何使用python的Pillow模块新建图像如何使用python的Pillow模块新建图像
© 2025 五度知识库
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com