图片隐水印生成/解码
复刻https://invisiblewatermark.net/的python版本实现。
算法原理,参见:https://invisiblewatermark.net/how-invisible-watermarks-work
安装
pip3 install pyinvisiblewatermark
使用
命令行使用
# encode
ivwm encode "hello world!" $YOUR_IMAGE_PATH
# decode
ivwm decode $INPUT_IMAGE_PATH $OUTPUT_IMAGE_PATH
代码使用
# encode
import pyinvisiblewatermark as ivwm
ivwm.generate_watermark(
img_fp="data/origin.png",
wm_txt="hello world!",
save_to="data/encode.png",
font="font/ZiTiQuanWeiJunHei-W1-2.ttf"
)
# decode
import pyinvisiblewatermark as ivwm
# 图片加水印示例
ivwm.extract_watermark(
img_fp="data/encode.png",
save_to="data/decode.png"
)
效果示例
| 原图 | 加水印图 | 水印解码图 | 水印文本 |
|---|---|---|---|
hello world!| |
Metadata
Release files for pyinvisiblewatermark 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyinvisiblewatermark-0.1.1.tar.gz | 3.3 kB | Without provenance | Details for pyinvisiblewatermark-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyinvisiblewatermark-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for pyinvisiblewatermark-0.1.1-py3-none-any.whl |
Total release size: 7.8 kB
Release files / pyinvisiblewatermark-0.1.1.tar.gz
| Download URL | pyinvisiblewatermark-0.1.1.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21b00646519d1b8b315ec9e771820c81ddf939b718f008a350f63b10d4d85c14
|
|
BLAKE2b-256 checksum How to use checksums |
dafac3821b9e78260d8738ec50790643d24303537ea47c9beccee90e9f72faf9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.10.13 Darwin/22.3.0
|
Release files / pyinvisiblewatermark-0.1.1-py3-none-any.whl
| Download URL | pyinvisiblewatermark-0.1.1-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c70963e0dc7feeeeed50ec783f702aa38037adf9e2fbdc36ed07828ab95ea83c
|
|
BLAKE2b-256 checksum How to use checksums |
e339f31aef308a6fe1ab54f7f523b7c713617fc3a2c8373bb3d23e16e014aeab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.10.13 Darwin/22.3.0
|
Security for pyinvisiblewatermark 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.