使用 python 将数据嵌入到二进制图像中

发布于 2024-10-20 01:37:13 字数 204 浏览 9 评论 0原文

我是Python新手,我正在尝试改进现有的将数据嵌入到二进制图像中的方法,并以最小的视觉失真。我正在尝试实现的当前方法需要有一个以每个像素为中心的 3x3 移动窗口,并分析窗口内区域的平滑度以及黑白簇的数量。然后,该信息将被传递到决策模块,该模块将决定要更改的最佳像素以嵌入数据。我尝试过 PIL 和 numPy,但没有取得太大成功,所以任何帮助我开始的建议将不胜感激。

谢谢。

I'm new to python and I'm attempting to improve on an existing method of embedding data in a binary image with minimal visual distortion. The current method that I am trying to implement needs to have a 3x3 moving window that centers on each pixel and analyses the smoothness of the area within the window and the amount of black and white clusters. This information would then be passed into a decision module that will decide on the best pixel to alter in order to embed data. I've played around with PIL and numPy, but without much success so any suggestions to get me started would be greatly appreciated.

Thanks.

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

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

发布评论

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

评论(1

掌心的温暖 2024-10-27 01:37:13

您可以查看Hachoir项目。它是一组用于剖析文件的 python 库/工具,即使您不知道格式。
就您而言,您可能对 hach​​oir-tools 中的一个示例感兴趣:

https: //bitbucket.org/haypo/hachoir/src/2a6cad1599c6/hachoir-tools/steganography.py

它们演示了如何以 mpeg 音频和 png 格式添加隐藏数据。请随意支持您自己的格式:)

You can check Hachoir project. It's a set of python library / tools to dissect files, even if you don't know the format.
In your case, you might be interested about one of their example in hachoir-tools :

https://bitbucket.org/haypo/hachoir/src/2a6cad1599c6/hachoir-tools/steganography.py

They demonstrate how you can add hidden data in mpeg audio and png format. Feel free to support your own format :)

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