在C#中添加不可见的图像水印?

发布于 2024-07-10 17:45:19 字数 99 浏览 7 评论 0原文

我想通过 C# 代码将多个隐形水印插入到我的 JPEG 图片中。 这意味着我需要一个 .NET 库来完成这项工作,而不是一些外部批处理应用程序。

有什么建议么?

I want to insert multiple invisible watermarks into my JPEG pictures through C# code. That means that I need a .NET library that does this work and not some external batch application.

Any suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

夜声 2024-07-17 17:45:19

有一个到 C# 的 image magick 库的端口,它可以轻松地为您执行该操作...

there is a port of image magick library to c# , and it can easily perform that operation for you...

┈┾☆殇 2024-07-17 17:45:19

在图片中存储“不可见”数据被称为“隐写术”。 在 Google 上搜索“steganography .net”即可找到这篇文章 作为它的热门歌曲 - 可能会被证明是有用的。

Storing "invisible" data in pictures is known as "steganography". A Google-search for "steganography .net" yields this article as its top hit - might prove useful.

生生漫 2024-07-17 17:45:19

这样做的目的是什么? 是为了让您能够识别从您网站上获取的 JPG 文件吗?

评论中的回应:“是的,我想通过使用一些强大且不可见的水印来保护我的图片。半可见的网站徽标不是一个选项......”

问题正是上面隐写术讨论中描述的问题,与图像的鲁棒性。

任何像您所描述的水印都可以用来识别整个图像的直接副本,但是对于 jpg 来说,在我看来,如果在编辑器中再次打开并保存它,就有可能会影响压缩的变化水印。 此外,如果有人窃取您的图像并对其进行更广泛的处理 - 修补色彩平衡,稍微裁剪等等,那么任何隐形水印似乎都不太可能足够强大以生存并保持可识别性。

不幸的是,我在这里没有解决方案,但问题本身绝非微不足道。 可能值得寻找其他方法,您也许可以与水印并行使用(也许是自定义元数据?防止图像被轻松保存?),以使您的图像更难被盗或降低它们的价值(如果它们)是...

What is the purpose of this? Is it to enable you to identify JPGs that have been taken from your site?

Response in comments: "Yes, I want to protect my pictures by using some robust and invisible watermark. Semi-visible site logo is not an option... "

The problem is precisely the one described in discussion of Steganography above, to do with the robustness of the image.

Any watermark like the one you describe can be used to identify a direct copy of the whole image, but with a jpg it seems to me that if it is even opened and saved again in an editor there is a chance of a change in compression affecting the watermark. Also if someone was to steal your image and do something more extensive with it- tinker with the colour balance, crop it a little and so on it seems unlikely that any invisible watermarking would be robust enough to survive and stay recogniseable.

Unfortunately I don't have a solution here, but the problem itself is far from trivial. It may be worth looking for other approaches to it, that you can perhaps use in parallel with watermarking ( custom metadata perhaps? preventing images being easily saved? ) to make it harder for your images to be stolen or to make them less valuable if they are...

溇涏 2024-07-17 17:45:19

devx.com 上的这篇文章包含一个库 (Stego),其中包含您可以使用的源代码:

保守秘密:使用 .NET 进行隐写术

实现该 API 后,
在 a 中隐藏消息很简单
.bmp 文件:

   ICoverFile cover = new BMPCoverFile("cover.bmp");
   cover.CreateStegoFile("stego.bmp","Hello","MyPwd");   

同样,您可以提取消息
同样容易:

   IStegoFile stego = new 
      BMPStegoFile("stego.bmp","MyPwd");
   Console.WriteLine(stego.HiddenMessage);

更新:哦,抱歉。 马特链接到同一篇文章...在写这个答案时没有看到这一点。

This article on devx.com contains a library (Stego) with source code you could use:

Keeping Secrets Secret: Steganography with .NET

After implementing that API, it's
trivial to hide a message inside a
.bmp file:

   ICoverFile cover = new BMPCoverFile("cover.bmp");
   cover.CreateStegoFile("stego.bmp","Hello","MyPwd");   

Likewise, you can extract the message
just as easily:

   IStegoFile stego = new 
      BMPStegoFile("stego.bmp","MyPwd");
   Console.WriteLine(stego.HiddenMessage);

UPDATE: Oh, sorry. Matt linked to the same article... didn't see that while writing this answer.

烟花易冷人易散 2024-07-17 17:45:19

如果您正在开发一个重要的应用程序,为什么不尝试付费服务呢?

DigimarcSignumtech 可以使用他们的 SDK 为您提供此类支持。

If it is a important application that you are working on, why not trying a paid service?

Digimarc and Signumtech can give you that kind of support using their SDK.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文