Skip to content

xianfengju/BlindWatermark

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BlindWatermark

Build Status

在图片上加隐藏的水印

  • 原理
    • Encode:
      原图 --- 变换 ---> 变换域 + 水印 --- 逆变换 ---> 带水印图
    • Decode:
      带水印图 --- 变换 ---> 变换域

Usage

Usage: java -jar BlindWatermark.jar <commands> [args...]
    commands:
        encode <option> <input> <watermark> <output>
        decode <option> <input> <output>
    encode options:
        -c discrete cosine transform
        -f discrete fourier transform
        -i image watermark
        -t text  watermark
    decode options:
        -c discrete cosine transform
        -f discrete fourier transform
    example:
        encode -ft input.png watermark output.png
        decode -fi input.png output.png

Build

gradle build

Demo

原图:

image

加文字水印(DFT):
java -jar BlindWatermark.jar encode -ft gakki-src.png test gakki-dft-text-ec.png

image

文字水印解码(DFT):
java -jar BlindWatermark.jar decode -f gakki-dft-text-ec.png gakki-dft-text-dc.png

image

加图片水印(DFT):
java -jar BlindWatermark.jar encode -fi gakki-src.png watermark.png gakki-dft-img-ec.png

image

图片水印解码(DFT):
java -jar BlindWatermark.jar decode -f gakki-dft-img-ec.png gakki-dft-img-dc.png

image

加文字水印(DCT):
java -jar BlindWatermark.jar encode -ct gakki-src.png test gakki-dct-text-ec.jpg

image

文字水印解码(DCT):
java -jar BlindWatermark.jar decode -c gakki-dct-text-ec.jpg gakki-dct-text-dc.jpg

image

加图片水印(DCT):
java -jar BlindWatermark.jar encode -ci gakki-src.png watermark.png gakki-dct-img-ec.jpg

image

图片水印解码(DCT):
java -jar BlindWatermark.jar decode -c gakki-dct-img-ec.jpg gakki-dct-img-dc.jpg

image

Reference

License

Copyright 2019 ww23(https://github.com/ww23/BlindWatermark).

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Packages

No packages published

Languages

  • Java 100.0%