{"id":13492119,"url":"https://github.com/guofei9987/blind_watermark","last_synced_at":"2025-05-13T17:08:52.549Z","repository":{"id":37940820,"uuid":"197206410","full_name":"guofei9987/blind_watermark","owner":"guofei9987","description":"Blind\u0026Invisible Watermark ，图片盲水印，提取水印无须原图！","archived":false,"fork":false,"pushed_at":"2024-06-23T12:29:59.000Z","size":4560,"stargazers_count":6385,"open_issues_count":30,"forks_count":739,"subscribers_count":38,"default_branch":"master","last_synced_at":"2025-05-06T20:42:46.074Z","etag":null,"topics":["blind-watermark","image-processing","watermark","watermark-image"],"latest_commit_sha":null,"homepage":"https://blindwatermark.github.io/blind_watermark/#/en/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/guofei9987.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":["https://www.guofei.site/微信打赏.jpg"],"open_collective":"blind_watermark"}},"created_at":"2019-07-16T14:08:51.000Z","updated_at":"2025-05-05T10:42:25.000Z","dependencies_parsed_at":"2023-11-23T06:38:15.399Z","dependency_job_id":"6cd9f6c9-2a55-4fdf-b2d8-eb8009c98073","html_url":"https://github.com/guofei9987/blind_watermark","commit_stats":{"total_commits":132,"total_committers":9,"mean_commits":"14.666666666666666","dds":"0.11363636363636365","last_synced_commit":"935ce9906ceff2dfe2b1706cabec481b979be121"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guofei9987%2Fblind_watermark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guofei9987%2Fblind_watermark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guofei9987%2Fblind_watermark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guofei9987%2Fblind_watermark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guofei9987","download_url":"https://codeload.github.com/guofei9987/blind_watermark/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253990468,"owners_count":21995774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blind-watermark","image-processing","watermark","watermark-image"],"created_at":"2024-07-31T19:01:03.283Z","updated_at":"2025-05-13T17:08:47.523Z","avatar_url":"https://github.com/guofei9987.png","language":"Python","funding_links":["https://www.guofei.site/微信打赏.jpg","https://opencollective.com/blind_watermark"],"categories":["Python","Repos","其他_机器视觉"],"sub_categories":["资源传输下载"],"readme":"\n\n\n# blind-watermark\n\nBlind watermark based on DWT-DCT-SVD.\n\n\n[![PyPI](https://img.shields.io/pypi/v/blind_watermark)](https://pypi.org/project/blind_watermark/)\n[![Build Status](https://travis-ci.com/guofei9987/blind_watermark.svg?branch=master)](https://travis-ci.com/guofei9987/blind_watermark)\n[![codecov](https://codecov.io/gh/guofei9987/blind_watermark/branch/master/graph/badge.svg)](https://codecov.io/gh/guofei9987/blind_watermark)\n[![License](https://img.shields.io/pypi/l/blind_watermark.svg)](https://github.com/guofei9987/blind_watermark/blob/master/LICENSE)\n![Python](https://img.shields.io/badge/python-\u003e=3.5-green.svg)\n![Platform](https://img.shields.io/badge/platform-windows%20|%20linux%20|%20macos-green.svg)\n[![stars](https://img.shields.io/github/stars/guofei9987/blind_watermark.svg?style=social)](https://github.com/guofei9987/blind_watermark/)\n[![fork](https://img.shields.io/github/forks/guofei9987/blind_watermark?style=social)](https://github.com/guofei9987/blind_watermark/fork)\n[![Downloads](https://pepy.tech/badge/blind-watermark)](https://pepy.tech/project/blind-watermark)\n[![Discussions](https://img.shields.io/badge/discussions-green.svg)](https://github.com/guofei9987/blind_watermark/discussions)\n\n\n- **Documentation:** [https://BlindWatermark.github.io/blind_watermark/#/en/](https://BlindWatermark.github.io/blind_watermark/#/en/)\n- **文档：** [https://BlindWatermark.github.io/blind_watermark/#/zh/](https://BlindWatermark.github.io/blind_watermark/#/zh/)  \n- **中文 readme** [README_cn.md](README_cn.md)\n- **Source code:** [https://github.com/guofei9987/blind_watermark](https://github.com/guofei9987/blind_watermark)\n\n\n\n# install\n```bash\npip install blind-watermark\n```\n\nFor the current developer version:\n```bach\ngit clone git@github.com:guofei9987/blind_watermark.git\ncd blind_watermark\npip install .\n```\n\n# How to use\n\n\n## Use in bash\n\n\n```bash\n# embed watermark into image:\nblind_watermark --embed --pwd 1234 examples/pic/ori_img.jpeg \"watermark text\" examples/output/embedded.png\n# extract watermark from image:\nblind_watermark --extract --pwd 1234 --wm_shape 111 examples/output/embedded.png\n```\n\n\n\n## Use in Python\n\nOriginal Image + Watermark = Watermarked Image\n\n![origin_image](docs/原图.jpeg) + '@guofei9987 开源万岁！' = ![打上水印的图](docs/打上水印的图.jpg)\n\n\nSee the [codes](/examples/example_str.py)\n\nEmbed watermark:\n```python\nfrom blind_watermark import WaterMark\n\nbwm1 = WaterMark(password_img=1, password_wm=1)\nbwm1.read_img('pic/ori_img.jpg')\nwm = '@guofei9987 开源万岁！'\nbwm1.read_wm(wm, mode='str')\nbwm1.embed('output/embedded.png')\nlen_wm = len(bwm1.wm_bit)\nprint('Put down the length of wm_bit {len_wm}'.format(len_wm=len_wm))\n```\n\nExtract watermark:\n```python\nbwm1 = WaterMark(password_img=1, password_wm=1)\nwm_extract = bwm1.extract('output/embedded.png', wm_shape=len_wm, mode='str')\nprint(wm_extract)\n```\nOutput:\n\u003e@guofei9987 开源万岁！\n\n### attacks on Watermarked Image\n\n\n|attack method|image after attack|extracted watermark|\n|--|--|--|\n|Rotate 45 Degrees|![旋转攻击](docs/旋转攻击.jpg)|'@guofei9987 开源万岁！'|\n|Random crop|![截屏攻击](docs/截屏攻击2_还原.jpg)|'@guofei9987 开源万岁！'|\n|Masks| ![多遮挡攻击](docs/多遮挡攻击.jpg) |'@guofei9987 开源万岁！'|\n|Vertical cut|![横向裁剪攻击](docs/横向裁剪攻击_填补.jpg)|'@guofei9987 开源万岁！'|\n|Horizontal cut|![纵向裁剪攻击](docs/纵向裁剪攻击_填补.jpg)|'@guofei9987 开源万岁！'|\n|Resize|![缩放攻击](docs/缩放攻击.jpg)|'@guofei9987 开源万岁！'|\n|Pepper Noise|![椒盐攻击](docs/椒盐攻击.jpg)|'@guofei9987 开源万岁！'|\n|Brightness 10% Down|![亮度攻击](docs/亮度攻击.jpg)|'@guofei9987 开源万岁！'|\n\n\n\n\n\n\n### embed images\n\nembed watermark:\n```python\nfrom blind_watermark import WaterMark\n\nbwm1 = WaterMark(password_wm=1, password_img=1)\n# read original image\nbwm1.read_img('pic/ori_img.jpg')\n# read watermark\nbwm1.read_wm('pic/watermark.png')\n# embed\nbwm1.embed('output/embedded.png')\n```\n\n\nExtract watermark:\n```python\nbwm1 = WaterMark(password_wm=1, password_img=1)\n# notice that wm_shape is necessary\nbwm1.extract(filename='output/embedded.png', wm_shape=(128, 128), out_wm_name='output/extracted.png', )\n```\n\n\n|attack method|image after attack|extracted watermark|\n|--|--|--|\n|Rotate 45 Degrees|![旋转攻击](docs/旋转攻击.jpg)|![](docs/旋转攻击_提取水印.png)|\n|Random crop|![截屏攻击](docs/截屏攻击2_还原.jpg)|![多遮挡_提取水印](docs/多遮挡攻击_提取水印.png)|\n|Mask| ![多遮挡攻击](docs/多遮挡攻击.jpg) |![多遮挡_提取水印](docs/多遮挡攻击_提取水印.png)|\n\n\n### embed array of bits\n\nSee it [here](/examples/example_bit.py)\n\n\nAs demo, we embed 6 bytes data:\n```python\nwm = [True, False, True, True, True, False]\n```\n\nEmbed:\n```python\nfrom blind_watermark import WaterMark\n\nbwm1 = WaterMark(password_img=1, password_wm=1)\nbwm1.read_ori_img('pic/ori_img.jpg')\nbwm1.read_wm([True, False, True, True, True, False], mode='bit')\nbwm1.embed('output/embedded.png')\n```\n\nExtract:\n```python\nbwm1 = WaterMark(password_img=1, password_wm=1, wm_shape=6)\nwm_extract = bwm1.extract('output/打上水印的图.png', mode='bit')\nprint(wm_extract)\n```\nNotice that `wm_shape` (shape of watermark) is necessary\n\nThe output `wm_extract` is an array of float. set a threshold such as 0.5.\n\n\n# Concurrency\n\n```python\nWaterMark(..., processes=None)\n```\n- `processes` number of processes, can be integer. Default `None`, which means using all processes.  \n\n## Related Project\n\n- text_blind_watermark (Embed message into text): [https://github.com/guofei9987/text_blind_watermark](https://github.com/guofei9987/text_blind_watermark)  \n- HideInfo（hide as image, hide as sounds, hide as text）：[https://github.com/guofei9987/HideInfo](https://github.com/guofei9987/HideInfo)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguofei9987%2Fblind_watermark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguofei9987%2Fblind_watermark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguofei9987%2Fblind_watermark/lists"}