
Pillow
Pillow
安果移不动
精通Android,Swift,Flutter,Python,Php,按键精灵,易语言。曾为华为录制精品课程,拥有资质:按键精灵顶级证书;
产品秀:https://www.anguomob.com
B站:https://space.bilibili.com/482453235
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
python Pillow.Image图片裁剪,缩放
缩放并裁剪 img = Image.open(fileSavePath) img2 = img.resize((1080, 1920)) img2.save(file81080SavePath) 裁剪 img = Image.open(fileNamePath) # 从左上角开始 剪切 200*200的图片 img2 = img.crop((0, 0, 1080, 2119))原创 2020-05-30 14:54:43 · 1120 阅读 · 0 评论 -
Python中用PIL/Pillow裁剪图片
如果系统中没有安装Pillow包,安装: pip install pillow 裁剪 # 导入pillow from PIL import Image # 加载原始图片 img = Image.open("lena.jpg") # 从左上角开始 剪切 200*200的图片 img2 = img.crop((0, 0, 200, 200)) img2.save("lena2.jpg") 从右下角开始(200*200) width = img.size[0] # 图片大小 heigh原创 2020-05-30 14:35:46 · 1213 阅读 · 0 评论