guofei9987 / blind_watermark

Blind&Invisible Watermark ,图片盲水印,提取水印无须原图!
https://blindwatermark.github.io/blind_watermark/#/en/
MIT License
5.75k stars 683 forks source link

执行后未生成嵌入水印后的图片 #141

Closed yaalyy closed 4 months ago

yaalyy commented 5 months ago

python所执行的源代码:

from blind_watermark import WaterMark 
import os

pwd = "ConnorImageWatermarkEncryption"

def embedding(originalImage, encryptedImage, msg):
    bwm1 = WaterMark(password_img=1, password_wm=1)
    bwm1.read_img(originalImage)
    wm = msg
    bwm1.read_wm(wm, mode='str')
    bwm1.embed(encryptedImage)
    len_wm = len(bwm1.wm_bit)
    print('Put down the length of wm_bit {len_wm}'.format(len_wm=len_wm))

if __name__ == "__main__":
    os.chdir(os.path.dirname(__file__))
    embedding('./test.png', './output/t.jpg', 'This is group1,group1, group-1')

print信息: Welcome to use blind-watermark, version = 0.4.4 Make sure the version is the same when encode and decode Your star means a lot: https://github.com/guofei9987/blind_watermark This message only show once. To close it: blind_watermark.bw_notes.close()

Put down the length of wm_bit 239

尝试过管理员模式运行,也试过图片格式为jpg, png, 都没有加密后的图片生成

Vanilla-chan-nya commented 4 months ago

有创建output文件夹吗

yaalyy commented 4 months ago

有创建output文件夹吗

没。。。 创建output文件夹后,图片可以生成了。

yaalyy commented 4 months ago

后续开发中可以新增 自动创建文件夹的特性, 或者在路径不存在的情况可以有 调试信息 提醒