Skip to content
项目

mchall/HiddenWatermark

在 GitHub 查看

关于

Embeds a hidden watermark in an image using a blind DWT-DCT approach

设计与媒体

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
0
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

Hidden Watermark

Embeds a hidden watermark in an image using a blind DWT-DCT approach. Unlike steganographic methods, this hidden watermark is resistant to various forms of attack. Limited to a black and white 32x32 watermark image.

Original Image + Watermark = Watermarked Image

Original + Watermark = Embedded Image

Image source: http://commons.wikimedia.org/wiki/Garden#/media/File:Rikugien3.jpg

Usage

The following code instantiates the default watermark class with the default watermark image. Then the watermark is embedded in a file, and the watermark is retrieved afterwards.

var fileBytes = File.ReadAllBytes(imageLocation);
var newFileBytes = Watermark.Default.EmbedWatermark(fileBytes);

var result = Watermark.Default.RetrieveWatermark(newFileBytes);

The following code instantiates the watermark class with the bytes read from a 32x32 watermark image and turns crop support on. Then the watermark is embedded in a file and simultaneously checked if an embedded watermark already exists.

var watermarkBytes = File.ReadAllBytes(watermarkLocation);
Watermark watermark = new Watermark(watermarkBytes);

var fileBytes = File.ReadAllBytes(imageLocation);
var result = watermark.RetrieveAndEmbedWatermark(fileBytes);

Watermark recovery results

Attack Recovered Watermark
No Attack 1
Blur 2
Flip Horizontal 3
Resize (1024x768->360x270) 4
Visible Watermarking 5
Crop 6
JPEG Quality 20% 7
Grayscale 8 (not resistant)
PrintScreen 9
Noise 10

Acknowledgements

Accord.NET: http://accord-framework.net/

探索相关项目

加载中…