1. 利用Image Creator來產生四張圖片,本次提示詞是"農村"。
2.再利用3D小畫家,記得要勾選畫布為透明畫布。
3.撰寫Python浮水印程式
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | import os from PIL import Image src_path = "./images/src" des_path = "./images/des" watermark_im = Image.open("./images/watermark.png") for img_name in os.listdir(src_path): print(img_name) src_im = Image.open(os.path.join(src_path, img_name)) src_im.show() x = int(src_im.width - watermark_im.width) y = int(src_im.height - watermark_im.height) src_im.paste(watermark_im,(x, y),watermark_im) src_im.save(os.path.join(des_path, img_name)) src_im.show() |
沒有留言:
張貼留言