blind_watermark icon indicating copy to clipboard operation
blind_watermark copied to clipboard

Attacks on the image does break the watermark

Open eroo36 opened this issue 1 year ago • 1 comments

I tested with this website and with GIMP to edit the watermarked image and I only crop/resize the image slightly for example used a JPG image with result of JPG as well: file 1: original: 329x731 cropped : 310x710

file 2: original: 4624 × 3472 resized: 4204 × 3157

the cropped/resized image has broken watermark result when i decode it again.

Code I use to add wm:

bwm1 = WaterMark(password_wm=1235)
bwm1.read_img(filepath)
wm = 'example'
bwm1.read_wm(wm, mode='str')
bwm1.embed(resultFilePath)
return send_file(f'temp/wm_{file.filename}')

Code I use to get wm:

bwm2 = WaterMark(password_wm=1235)
wm_extract = bwm2.extract(filepath, wm_shape=len(bwm1.wm_bit), mode='str')
return jsonify({'watermark': wm_extract})

eroo36 avatar Oct 05 '22 08:10 eroo36