使用 python 去除照片背景的方法
① 安装rembg与pillow库
② 运行如下python代码。输入与输出的图片地址自己修改。
from rembg import remove
from PIL import Image
input_path = ‘images.jpg’
output_path = ‘images.png’
inp = Image.open(input_path)
output = remove(inp)
output.save(output_path)
③ 运行程序即可获取去除背景的png图片。
- 打赏
- 分享
分享到...

请选择打赏方式



- 微信
- 支付宝
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容