Giter Site home page Giter Site logo

watermark_demo's Introduction

Digital image encryption ---- invisible watermark

Introduction

Invisible watermark contains two algorithms: significant Bit(LSB) and Discrete Cosine Transform(DCT) refer guofei9987 , importantly , the DCT algorithm needs the carrier image size should 16 times greater than watermark, or it doesn't work.

Requirements

These scripts need python 3.6+ and the following libraries:

numpy==1.19.5
opencv-python==4.5.1.48
PyWavelets==1.1.1

You can easy to install these libraries by :

pip install -r requirements.txt

Running

First of all, you need satisfy the environment requirements, then run

python main.py --ori_filename <carrier image path> --wm_filename <watermark path>

you can get a image include watermark, the default path under***./img/***.

Encode

Above-mentioned is the most convenient way encode, but formally, you need to run this

python main.py --ori_filename <carrier image path> --wm_filename <watermark path> --coder encoder

For example

python main.py --ori_filename ./img/carrier.png  --wm_filename ./img/watermark.png --coder encoder

In addition, you can use -wm_method to choose DCT algorithm (default) or LSB algorithm to encode the watermark, you can just run like this

python main.py --ori_filename ./img/carrier.png  --wm_filename ./img/watermark.png --coder encoder --wm_method LSB

Furthermore,it also support the usual attack method to destroy image,you need to run this

python main.py --ori_filename ./img/carrier.png  --wm_filename ./img/watermark.png --coder encoder --att_method saltnoise

The all attack methods you can look up in ./src/attack.py, and the watermarked image will be saved under the path *./img/.

Decode

Above all, you need to confirm the watermarked image is encoded by which algorithm, then you can run like this

python main.py --wm_filename ./img/watermark.png --ori_wm_filename ./img/ori_wm.png --coder decoder 

As you see, the all algorithms needs the watermark image to decode, because the watermark size we don't know.

watermark_demo's People

Contributors

hammer-888 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.