We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
想处理一下蒙版,这个生成海报时候非常有用 我用python写了一个,就是一个黑白渐变图 和一个正常的图片蒙版。 `#!/usr/bin/python3 import os from PIL import Image
path = "E:\111\titlepic222" path2 = "E:\111\titlepic2222"
for filename in os.listdir(path):
# 打开前景图片和蒙版图片 image_path = os.path.join(path, filename) foreground = Image.open(image_path) mask = Image.open("mask.png").convert("L") # 将蒙版图片转换为灰度图 # 应用蒙版 foreground.putalpha(mask) image_path2 = os.path.join(path2, filename) foreground.save(image_path2)`
The text was updated successfully, but these errors were encountered:
好的
Sorry, something went wrong.
No branches or pull requests
想处理一下蒙版,这个生成海报时候非常有用
我用python写了一个,就是一个黑白渐变图
和一个正常的图片蒙版。
`#!/usr/bin/python3
import os
from PIL import Image
数据路径
path = "E:\111\titlepic222"
path2 = "E:\111\titlepic2222"
调用示例
for filename in os.listdir(path):
The text was updated successfully, but these errors were encountered: