Click here to Skip to main content
6,594,932 members and growing! (15,389 online)
Email Password   helpLost your password?
Multimedia » General Graphics » Barcodes     Intermediate License: The Code Project Open License (CPOL)

Porcupine

By Lampros Giampouras

A library for visible and invisible image watermarking
C++ (VC6), Windows (WinXP), MFC, Dev
Version:3 (See All)
Posted:2 Oct 2006
Updated:15 Sep 2009
Views:43,481
Bookmarked:76 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
16 votes for this article.
Popularity: 5.43 Rating: 4.51 out of 5

1
1 vote, 6.3%
2

3
2 votes, 12.5%
4
13 votes, 81.3%
5

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)

About the Author

Lampros Giampouras


Member
(C) Lampros Giampouras
Location: Greece Greece

Other popular General Graphics articles:

  • A flexible charting library for .NET
    Looking for a way to draw 2D line graphs with C#? Here's yet another charting class library with a high degree of configurability, that is also easy to use.
  • CxImage
    CxImage is a C++ class to load, save, display, transform BMP, JPEG, GIF, PNG, TIFF, MNG, ICO, PCX, TGA, WMF, WBMP, JBG, J2K images.
  • 3D Pie Chart
    A class library for drawing 3D pie charts.
  • Barcode Image Generation Library
    This library was designed to give an easy class for developers to use when they need to generate barcode images from a string of data.
  • ImageStone
    An article on a library for image manipulation.
Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 25 of 67 (Total in Forum: 67) (Refresh)FirstPrevNext
Generalreally good write Pinmemberzzh1221518:52 22 Sep '09  
GeneralThe full demo can't download Pinmemberluoxing3:37 5 Aug '09  
GeneralRe: The full demo can't download PinmemberLampros G0:12 6 Aug '09  
GeneralRe: The full demo can't download Pinmemberluoxing1:02 6 Aug '09  
GeneralHow to open j2k (JPEG 2000) files Pinmemberprashant_1440:50 5 Jun '09  
GeneralRe: How to open j2k (JPEG 2000) files PinmemberLampros G7:30 6 Jun '09  
GeneralRemove watermarks PinmemberMember 28349001:46 20 May '09  
AnswerRe: Remove watermarks PinmemberLampros G2:48 20 May '09  
JokeRe: Remove watermarks PinassociateJim Crafton7:23 18 Sep '09  
GeneralRe: Remove watermarks PinmemberLampros G11:21 18 Sep '09  
GeneralRe: Remove watermarks Pinmemberaspdotnetdev14:39 30 Sep '09  
GeneralCorrelation between watermarks Pinmembereddieweenie1:46 4 Feb '09  
GeneralRe: Correlation between watermarks PinmemberLampros G11:14 7 Feb '09  
GeneralI need a invisible watermark in JPG image Pinmemberyangxueya198316:38 21 Jan '09  
GeneralRe: I need a invisible watermark in JPG image PinmemberLampros G22:59 21 Jan '09  
GeneralRe: I need a invisible watermark in JPG image Pinmemberyangxueya198317:15 22 Jan '09  
GeneralRe: I need a invisible watermark in JPG image PinmemberLampros G22:37 22 Jan '09  
Generalhow can i make the programme run? Pinmemberbirrz10:50 27 Dec '08  
GeneralRe: how can i make the programme run? [modified] PinmemberLampros G0:46 5 Jan '09  
QuestionError when run source code PinmemberHidden_Code2:53 18 May '08  
AnswerRe: Error when run source code PinmemberLampros G3:57 18 May '08  
GeneralRe: Error when run source code [modified] PinmemberHidden_Code4:18 18 May '08  
GeneralRe: Error when run source code PinmemberLampros G4:37 18 May '08  
GeneralRe: Error when run source code PinmemberHidden_Code4:46 18 May '08  
GeneralRe: Error when run source code PinmemberLampros G5:44 18 May '08  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 15 Sep 2009
Editor: Deeksha Shenoy
Copyright 2006 by Lampros Giampouras
Everything else Copyright © CodeProject, 1999-2009
Web13 | Advertise on the Code Project