{"id":20477146,"url":"https://github.com/mylamour/wwmark","last_synced_at":"2026-03-08T17:37:53.318Z","repository":{"id":40970255,"uuid":"238898193","full_name":"mylamour/Wwmark","owner":"mylamour","description":"Watermark Swiss Army Knife","archived":false,"fork":false,"pushed_at":"2023-10-03T21:45:32.000Z","size":2127,"stargazers_count":7,"open_issues_count":2,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-27T03:51:22.286Z","etag":null,"topics":["blind-watermark","ffmpeg","opencv-python","watermark"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mylamour.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2020-02-07T10:36:06.000Z","updated_at":"2025-01-17T18:48:37.000Z","dependencies_parsed_at":"2024-08-01T21:53:52.059Z","dependency_job_id":null,"html_url":"https://github.com/mylamour/Wwmark","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mylamour%2FWwmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mylamour%2FWwmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mylamour%2FWwmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mylamour%2FWwmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mylamour","download_url":"https://codeload.github.com/mylamour/Wwmark/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248717251,"owners_count":21150388,"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","ffmpeg","opencv-python","watermark"],"created_at":"2024-11-15T15:25:58.082Z","updated_at":"2026-03-08T17:37:53.269Z","avatar_url":"https://github.com/mylamour.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=center\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/12653147/74099251-93627880-4b5c-11ea-9340-823cbc9eede6.png\" /\u003e\n\u003c/div\u003e\n\n\n# Intro\n\nIt based on ffmpeg and opencv. Simply, you can add text or pictures to the target. we support the image, video and pdf to add watermark. Also, original intention is make a mark. So, it should be simply on bottom right, we don't support full screen watermark by default. So you can define it with your local config file with `p` field or use it with '--blind' options. If you want to look more detail, please read the document in FFMPEG homepage. \n\n| Original / Watermark option | add image | add text | custom position (-p) | invisible(--blind) | clean watermark |\n|-----------------------------|-----------|----------|----------------------|--------------------|-----------------|\n| image                       | √         | √        | √                    | √                  | √               |\n| video                       | √         | √        | √                    | ×                  | x               |\n| pdf                         | √         | √        | √                    | x                  | √               |\n\n# Install\n\n* Ubuntu\n\n```bash\nsudo apt-get install python3-pip python3-setuptools python3-opencv ffmpeg\ngit clone https://github.com/mylamour/Wwmark \u0026\u0026 cd Wwmark\npip3 install -r requirements.txt\n\n# if you want to install this tools, alias it with shell config file\n# echo alias wwmark=\\\"python $PWD/main.py\\\"  \u003e\u003e ~/.zshrc\n# source ~/.zshrc\n\n```\n\n# Useage\n\n\u003cdiv align=center\u003e\n\n[![asciicast](https://asciinema.org/a/7cwAWEuXm3BN9E10hwhirTm5b.svg)](https://asciinema.org/a/7cwAWEuXm3BN9E10hwhirTm5b)\n\n\u003c/div\u003e\n\n```bash\n\n\u003e # echo add image watermark\n\u003e python main.py image -i test/h.mp4 -m test/wm.png -o test/h2.mp4\n\u003e python main.py image -i test/DLP\\ ml.pdf -m test/wm.png -o test/xxx.pdf\n\u003e python main.py image -i test/guest.jpg -m test/wm.png -o wi_guest.png\n\u003e # echo with blind watermark\n\u003e python main.py image -i test/guest.jpg -m test/wm.png -o wi_guest.png --blind\n\u003e # also you can add text watermark\n\u003e python main.py text -i test/h.mp4 -m \"WOWW\" -p '{\"fontsize\":\"50\"}' -o test/h3.mp4\n\u003e python main.py text -i test/guest.jpg -m \"人生何处不相逢\" -o test/wt_guest.png\n\u003e python main.py text -i test/guest.jpg -m \"人生何处不相逢\" -o test/wt_guest.png --blind\n\u003e # if you got blind watermark, may be you want show it\n\u003e python main.py show --type text test/wt_guest.png\n\u003e python main.py show --type text -i test/wt_guest.png\n\u003e python main.py show --type image -i test/wi_guest.png -m test/wm.png -o wm.show.png\n\u003e python main.py show --type image -i test/guest.jpg -m test/wi_guest.png -o wm.show.png\n\u003e # custom your watermark location\n\u003e python main.py image -i test/DLP\\ ml.pdf -m test/wm.png -o test/xxx.pdf -p center\n\u003e python main.py image -i test/a.pdf -m test/wm.png -o test/test.pdf -p '{\"x\": \"main_w-overlay_w-5\",\"y\": \"5\"}'\n\u003e # clean the watermark, it good for alpha \u003c 0.5 watermark. \n\u003e python main.py clean -i test/test.pdf -m test/wm.png -o test/oh.pdf\n\u003e python main.py clean -i test/wi_guest.png -o test/oh.png \n```\n\n\u003e it's good way to check your font file in linux system: `fc-list :lang=zh`\n\n## Advance With Config file\n\nJust run `python main.py config -f config.json`. The following field must be included:\n* action: text/image\n* i: input file path\n* m: mark text or mark file path\n* o: output processed file path\n* b: blind watermark or not, only support image blind\n* p: custom parameters for your action with ffmpeg, image should checkout `overlay`, text should checkout `drawtext`\n* p -\u003e location: custom location, only for select special pdf pages\n* p -\u003e aa: only for image watermark process, 0-1.0 with different tranparency\n\n`config.json` for add text\n```json\n{\n    \"action\" : \"text\",\n    \"i\" : \"test/a.pdf\",\n    \"m\" : \"人生得意须尽欢\",\n    \"o\" : \"test/test.pdf\",\n    \"b\" : false,\n    \"p\" : { \n        \"x\" : \"main_w/3\",\n        \"y\" : \"10\",\n        \"fontsize\" : \"66\",\n        \"fontfile\" : \"DroidSansFallbackFull.ttf\",\n        \"box\" : \"1\",\n        \"boxcolor\" : \"red\"        \n    }\n}\n```\n\n`config.json` for add image\n```json\n{\n    \"action\" : \"text\",\n    \"i\" : \"test/a.pdf\",\n    \"m\" : \"test/wm.png\",\n    \"o\" : \"test/test.pdf\",\n    \"b\" : false,\n    \"p\" : { \n        \"location\" : \"2,4,6\",\n        \"x\" : \"main_w/3\",\n        \"y\" : \"10\",\n        \"aa\": \"0.4\",\n    }\n}\n\n```\n\n# TODO\n\n* [ ] Delete Logo (OCR + Delete Logo)\n* [ ] Web UI \u0026 Handwriting\n* [ ] Human Kindly Output \u0026 Docs\n* [ ] Encrype Sinature Automaticly\n* [ ] tests \u0026 setup.sh\n\n# Resources\n\n* [关于水印这件“小事”](https://github.com/mylamour/blog/issues/71)\n* [how to add transparent watermark](https://stackoverflow.com/questions/10918907/how-to-add-transparent-watermark-in-center-of-a-video-with-ffmpeg)\n* [ffmpeg-python](https://github.com/kkroening/ffmpeg-python/)\n* [ffmpeg-python docs](https://kkroening.github.io/ffmpeg-python/)\n* [ffmpeg simply useage](http://iami.xyz/Image-Parse/)\n* [ffmpeg overlay](https://ffmpeg.org/ffmpeg-filters.html#overlay-1)\n* [BlindWaterMark](https://github.com/chishaxie/BlindWaterMark)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmylamour%2Fwwmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmylamour%2Fwwmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmylamour%2Fwwmark/lists"}