python--PIL初探

本文通过Python的PIL库演示了基本的图像处理操作,包括打开图像文件、旋转裁剪区域并重新粘贴、调整图像大小以及颜色通道分离与合并等。还展示了如何混合两张图像。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

from PIL import *
image=Image.open('10.jpg')
#box = (20, 0,70,55)
#region = image.crop(box)
#region = region.rotate(180)
#image.paste(region,box)
#width,height = image.size
#image2=image.resize((width*2,height*2))
#print(image2.size)
#image2.show()
#width,height = image.size
#image2=image.resize((width*4,height*4))
#image2.save('captcha2.jpg')
r,g,b=image2.split()
image2=Image.merge('RGB',(g,b,r))


image5=Image.blend(image4,image,0.3333)
image5.show()
image.show()
明天整理~
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值