linyacool/blind-watermark

a jpg pic can't see watermark

idonkeyliu opened this issue · 7 comments

after decode, Jpg can't see watermark. The pic is a vertical pic.
ori

Jpg format is lossy compression , you'd better use some lossless compression formats like bmp, png, gif.

OK, thank. I'll have a try.

pxpy commented

PS C:\Users\panxin\Desktop> python encode.py --image 3d.tif --watermark wm.png --result jm.tif
libpng warning: iCCP: known incorrect sRGB profile
Traceback (most recent call last):
File "encode.py", line 54, in
main()
File "encode.py", line 30, in main
encode(img, wm, res, alpha)
File "encode.py", line 39, in encode
x, y = range(height / 2), range(width)
TypeError: 'float' object cannot be interpreted as an integer

@pxpy Could you please show me your picture ? My email : xxbbb@vip.qq.com

Zola commented

I was verified that jpeg format supported.

something wrong when I add argument -- alpha

$python encode.py --image ori.jpg --watermark watermark.jpg --result res.jpg --alpha 5
Traceback (most recent call last):
  File "encode.py", line 55, in <module>
    main()
  File "encode.py", line 31, in main
    encode(img, wm, res, alpha)
  File "encode.py", line 50, in encode
    res_f = img_f + alpha * tmp
TypeError: ufunc 'multiply' did not contain a loop with signature matching types dtype('S32') dtype('S32') dtype('S32')

@Zola Sorry for that, now I have fixed it.

The Python3 version of the blind watermark can be used, but it has no effect. It is not the image range is wrong or the watermark cannot be loaded. I hope I can fix it, or I need to know which libraries need to be installed.