Click here to Skip to main content
11,488,877 members (78,068 online)
Click here to Skip to main content

Porcupine

, 15 Sep 2009 CPOL 207.6K 12.8K 115
Rate this:
Please Sign up or sign in to vote.
A library for visible and invisible image watermarking

Porcupine ScreenShot

Introduction

Porcupine deals with digital image watermarking. You can embed any visible watermark like a text or another image in any position, or store information invisibly inside using a secret key (password).

Digital watermarking is a type of Steganography. In this field, except for the storage capacity of the host, the integrity of the information embedded to the host is very important. It is a technique which allows the dissimulation of information that verifies the owner, in digital sound, video, or image (in this case). The information can be encrypted. It constitutes a group of bits containing information about the creator, the owner, or the signal itself. Digital watermarking aims to validate the host and the undeniable identity of the legal owner. It provides a way for controlling host signals and represents the rightful holder. It also discourages illegal reproduction, and provides a way for safe distribution via the internet.

Some applications of digital watermarking:

  • The protection of intellectual rights, which is the most important application. When an illegal reproduction is detected, the offender should suffer the consequences of the law.
  • The proof of authenticity. The host must carry the digital signature of the creator.
  • The integrity of the host, if it continues to carry the digital signature.
  • The dissuasion of reproduction (copy control), caused by the fear of the probability that the offenders will be perceptible and suffer the consequences of the law.
  • The transmission of information without becoming perceptible from a third person, thanks to the invisible placement inside the host and its likely encrypted form.

Porcupine supports all of the known image formats (BMP, GIF, ICO, TGA, JPEG, PNG, TIFF, JPEG-2000, etc.).

Features

Visible Watermarking

  • Text Watermarking: Embeds a text on the image with the color and position of your choice. Each time, the text color selected and the pixel colors behind the text are checked. If they are the same, the text color changes automatically.
  • Image Watermarking: Embeds an image of your choice. Embedding options are via logical AND, OR, XOR, adding or subtracting, or drawing using the alpha channel.

Invisible Watermarking

Spatial Domain

  • LSB manipulation: Hides any file in the Least Significant Bit of pixels chosen by a certain equation. This could be done randomly but that way, there should be a certain threshold on the file size to be watermarked (random numbers can not be given forever). The equation solution solves this issue, and exploits the image dimensions. Furthermore, there are two "LSB watermarking" options with different pixel positions for multiple watermarking. This type of watermark is considered a "fragile watermark". It can be destroyed with the slightest manipulation (so don't save the image as JPEG). The information is protected via XOR scrambling or Blowfish encryption.

Example

Watermarked

Attack Results

Attacks

  • Patchwork: This is a statistical method that adds a Gaussian distribution. There is no information stored. The distribution is added randomly, and its existence proves the authenticity of the image.

Example

Patchwork example

Attack Results

Attack Results

Frequency Domain

  • DCT Watermarking: Embeds information in the frequency domain. This is done using the 2-D Discrete Cosine Transform. The information is stored in the low-mid frequencies of the image. The storage capacity of this technique is very poor. In most cases, one or two words are enough. To prevent image destruction, the user is required to give the smallest DCT coefficient above which the watermark will be inserted. If a small coefficient, which doesn't contribute to the image creation, is changed, the image will be destroyed. This method is considered a robust watermarking method. Porcupine uses only grayscale images for this technique.

Example and attack results

DCT example

  • Batch Watermarking: This option allows you to simultaneously put a visible or invisible watermark in a number of images. The "LSB watermark" and "Patchwork" options save the final images in BMP format as it is a format with no compression.

Among others, there is also an FTP upload available for uploading your watermarked images, a text reader, and a PSNR calculator.

Image Library

Basic Image Processing Classes in:

Porcupine Index Theory

CxImage

eikonaDoc.h
eikonaView.h
mass.h

To run the program, you have to download the CxImage Library and do a batch build. Then download the Porcupine source and place the folder inside the CxImage folder, along with the others (bin, CxImage, Debug, demo, etc..). Download the required LIBs and place them inside the Porcupine source folder. Since you want to mess with the source code and have Visual Studio installed, you probably don't need the required DLLs. You're ready to go.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Lampros Giampouras
Software Developer
Greece Greece
Physicist/SW Engineer

Comments and Discussions

 
QuestionHow to remove a visible watermark ? Pin
mozart198314-Mar-13 17:30
membermozart198314-Mar-13 17:30 
QuestionHow to Dynamically image watermarking ? Pin
nikhil94212-Aug-12 17:58
membernikhil94212-Aug-12 17:58 
AnswerRe: How to Dynamically image watermarking ? Pin
Lampros Giampouras2-Aug-12 23:28
memberLampros Giampouras2-Aug-12 23:28 
GeneralMy vote of 5 Pin
J4S21-May-12 22:53
memberJ4S21-May-12 22:53 
QuestionWhich version of Cximage do I need to download and build? Please give me some help! Pin
jiangqiong22-Oct-11 3:57
memberjiangqiong22-Oct-11 3:57 
QuestionI cann't build from your source code? Pin
12kaka25-Aug-11 19:40
member12kaka25-Aug-11 19:40 
GeneralFeel free to upgrade this program ! Pin
Lampros Giampouras7-Dec-09 11:10
memberLampros Giampouras7-Dec-09 11:10 
GeneralI can't download the full demo Pin
lzlm11-Nov-09 0:34
memberlzlm11-Nov-09 0:34 
GeneralRe: I can't download the full demo Pin
lzlm11-Nov-09 0:57
memberlzlm11-Nov-09 0:57 
GeneralRe: I can't download the full demo Pin
Lampros Giampouras11-Nov-09 1:59
memberLampros Giampouras11-Nov-09 1:59 
AnswerRe: I can't download the full demo Pin
Lampros Giampouras11-Nov-09 2:18
memberLampros Giampouras11-Nov-09 2:18 
GeneralRe: I can't download the full demo Pin
lzlm11-Nov-09 2:40
memberlzlm11-Nov-09 2:40 
Generalreally good write Pin
zzh1221522-Sep-09 18:52
memberzzh1221522-Sep-09 18:52 
GeneralThe full demo can't download Pin
luoxing5-Aug-09 3:37
memberluoxing5-Aug-09 3:37 
GeneralRe: The full demo can't download Pin
Lampros G6-Aug-09 0:12
memberLampros G6-Aug-09 0:12 
GeneralRe: The full demo can't download Pin
luoxing6-Aug-09 1:02
memberluoxing6-Aug-09 1:02 
QuestionHow to open j2k (JPEG 2000) files Pin
prashant_1445-Jun-09 0:50
memberprashant_1445-Jun-09 0:50 
AnswerRe: How to open j2k (JPEG 2000) files Pin
Lampros G6-Jun-09 7:30
memberLampros G6-Jun-09 7:30 
GeneralRemove watermarks Pin
Member 283490020-May-09 1:46
memberMember 283490020-May-09 1:46 
I want to remove watermarks from some pictures. How can I do that?

Rajeev Nandal
AnswerRe: Remove watermarks Pin
Lampros G20-May-09 2:48
memberLampros G20-May-09 2:48 
JokeRe: Remove watermarks Pin
Jim Crafton18-Sep-09 7:23
memberJim Crafton18-Sep-09 7:23 
GeneralRe: Remove watermarks Pin
Lampros G18-Sep-09 11:21
memberLampros G18-Sep-09 11:21 
GeneralRe: Remove watermarks Pin
aspdotnetdev30-Sep-09 14:39
memberaspdotnetdev30-Sep-09 14:39 
GeneralRe: Remove watermarks Pin
mozart198314-Mar-13 17:21
membermozart198314-Mar-13 17:21 
GeneralCorrelation between watermarks Pin
eddieweenie4-Feb-09 1:46
membereddieweenie4-Feb-09 1:46 
GeneralRe: Correlation between watermarks Pin
Lampros G7-Feb-09 11:14
memberLampros G7-Feb-09 11:14 
GeneralI need a invisible watermark in JPG image Pin
yangxueya198321-Jan-09 16:38
memberyangxueya198321-Jan-09 16:38 
GeneralRe: I need a invisible watermark in JPG image Pin
Lampros G21-Jan-09 22:59
memberLampros G21-Jan-09 22:59 
GeneralRe: I need a invisible watermark in JPG image Pin
yangxueya198322-Jan-09 17:15
memberyangxueya198322-Jan-09 17:15 
GeneralRe: I need a invisible watermark in JPG image Pin
Lampros G22-Jan-09 22:37
memberLampros G22-Jan-09 22:37 
Questionhow can i make the programme run? Pin
birrz27-Dec-08 10:50
memberbirrz27-Dec-08 10:50 
AnswerRe: how can i make the programme run? [modified] Pin
Lampros G5-Jan-09 0:46
memberLampros G5-Jan-09 0:46 
QuestionError when run source code Pin
Hidden_Code18-May-08 2:53
memberHidden_Code18-May-08 2:53 
AnswerRe: Error when run source code Pin
Lampros G18-May-08 3:57
memberLampros G18-May-08 3:57 
GeneralRe: Error when run source code [modified] Pin
Hidden_Code18-May-08 4:18
memberHidden_Code18-May-08 4:18 
GeneralRe: Error when run source code Pin
Lampros G18-May-08 4:37
memberLampros G18-May-08 4:37 
GeneralRe: Error when run source code Pin
Hidden_Code18-May-08 4:46
memberHidden_Code18-May-08 4:46 
GeneralRe: Error when run source code Pin
Lampros G18-May-08 5:44
memberLampros G18-May-08 5:44 
GeneralRe: Error when run source code Pin
Hidden_Code18-May-08 5:53
memberHidden_Code18-May-08 5:53 
GeneralRe: Error when run source code Pin
Lampros G18-May-08 6:08
memberLampros G18-May-08 6:08 
GeneralRe: Error when run source code Pin
Hidden_Code19-May-08 10:35
memberHidden_Code19-May-08 10:35 
AnswerRe: Error when run source code Pin
Lampros G20-May-08 1:16
memberLampros G20-May-08 1:16 
QuestionRe: Error when run source code Pin
Hidden_Code20-May-08 11:41
memberHidden_Code20-May-08 11:41 
AnswerRe: Error when run source code Pin
Lampros G20-May-08 23:55
memberLampros G20-May-08 23:55 
GeneralRe: Error when run source code [modified] Pin
Hidden_Code21-May-08 0:53
memberHidden_Code21-May-08 0:53 
GeneralRe: Error when run source code [modified] Pin
Lampros G22-May-08 6:50
memberLampros G22-May-08 6:50 
QuestionSource code runing Pin
Hidden_Code12-May-08 9:42
memberHidden_Code12-May-08 9:42 
AnswerRe: Source code runing Pin
Lampros G12-May-08 10:48
memberLampros G12-May-08 10:48 
GeneralRe: Source code runing Pin
Hidden_Code12-May-08 11:07
memberHidden_Code12-May-08 11:07 
GeneralRe: Source code runing Pin
Lampros G13-May-08 0:04
memberLampros G13-May-08 0:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150520.1 | Last Updated 15 Sep 2009
Article Copyright 2006 by Lampros Giampouras
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid