Digital Image Watermarking Using Discrete Cosine Transform Biology Essay

Published: Last Edited:

This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.

Abstract-The aim of this project is to embed a digital watermark in an image to prove its ownership, authenticity and to prevent illegal reproduction of copyright images. A Binary Image is embedded in the image using DCT. The selected DCT coefficients of the image are replaced by the DCT coefficients of the binary image and then the IDCT of the image is taken to get the watermarked image. The watermarked image hence obtained is quite robust and imperceptible to attack.

Keywords-Discrete Cosine Transform (DCT), Inverse Discrete Cosine Transform (IDCT)


Digital watermarking is a process of embedding unobtrusive marks or labels into digital content. These embedded marks are typically imperceptible (invisible) that can later be detected or extracted. There are many watermarking techniques available for images, audio and videos. A digital water mark has been defined by researchers as identification code which carries certain information about the copyright owner, the creator of the work, the authorized consumer, and so on. It is permanently embedded into digital data for copyright protection and may be used for checking whether the data has been modified. The watermark can only be detected if the contents of the watermark are known. This property of the watermark determines the way it is used in practical applications.

Watermarks are broadly divided into two categories - Visible and Invisible. Visible watermarking is a visible translucent image, which is overlaid on the image. It could be your name, copyright, comment, website address, your logo, text or graphical objects. Image filters, dates, photo details and other EXIF information, which holds the rights to the primary image can also be used for image watermarking. Watermarking processing allows the primary image to be viewed, but still marks it clearly as the property of the owning organization.

Invisible watermarking is the digital data that is added to audio, images or video. But it cannot be perceived as such. Because of its different applications, there are two very different types of invisible watermarking.

Invisible watermarking, which is destroyed when the image is manipulated digitally in any way may be useful in proving authenticity of an image. If the watermark is still intact, then the image has not been "doctored." If the watermark has been destroyed, then the image has been tampered with. Such a technology might be important, for example, in admitting digital images as evidence in court.

Invisible watermarking, which is very resistant to destruction under any image manipulation might be useful in verifying ownership of an image suspected of misappropriation. Digital detection of the watermark would indicate the source of the image.

The main contribution of this paper is to present a new watermarking scheme that is based on discrete cosine transform

(DCT) and Joint Photographic Experts Group (JPEG) model in the feature domain. It also gives an up-to-date overview of the field of watermarking. Section 2 presents the main applications and properties of watermarking. Section 3 elaborates on the techniques of digital watermarking. The proposed watermarking scheme is presented in Section 4. This is followed by the experiments and results in Section 5. Finally, the conclusions are presented in Section 6.


One of the main applications of watermarking is the copyright protection of digital media. In the past duplicating art work was quite complicated and required a high level of expertise for the counterfeit to look like the original. However, in the digital world this is not true. Now it is possible for almost anyone to duplicate or manipulate digital data and not lose data quality. One way to tackle this problem would be to embed a watermark in the image which permits identification of the owner of the work. In the field of data security, watermarks may be used for certification, authentication, and conditional access. Certification is an important issue for official documents, such as identity cards or passports. Another application is the authentication of image content. The goal of this application is to detect any alterations and modifications in an image. The three pictures below illustrate this application. The picture on the left shows an original photo of a car that has been protected with a watermarking technology. In the centre, the same picture is shown but with a small modification: the numbers on the license plate have been changed. The picture on the right shows the photo after running the digital watermark detection program on the tampered photo. The tampered areas are indicated in white. We can clearly see that the detected area corresponds to the modifications applied to the original photo.

Using digital watermarks for integrity verification: the protected image is the image (a) above; a modified image is obtained by swapping the numbers 9 and 4 of the number plate (b); digital watermarking technology allows detecting and highlights the modified areas, as shown on (c).

Fig 1 Embedding and Detecting systems of Digital Watermarking

There are three functional components that are required in order to embed a watermark in an image. These are a watermark carrier, a watermark generator and a carrier modifier. A watermark carrier is a list of data elements from the original image used for encoding the watermark. The watermark is a binary image. The carrier modifier adds the generated noise signals to the selected carrier. Embedding the watermark and detecting the watermark are the operations in the watermarking of digital media, which enable the owner to be identified. The watermarking scheme can be represented symbolically by

Iw = E(Io,W)

Where Io, W and Iw denote the original multimedia signal (audio, image or video), the watermark containing the information that the owner wishes to embed, and the watermarked signal, respectively. The embedding function E modifies Io according to W. Fig. 1(a) shows a general watermarking scheme.

For watermark detection, a detecting function D is used. This operation is represented by

W' = D(R, Io)

Where R is the signal to be tested, whether it is watermarked or not and R could be a distorted version of Iw. The extracted watermark sequence (W') is compared with W and a Yes/No decision is made. The decision is based on a correlation measure Z, as follows:

Z(W',W) = {1, c >= y

{0, otherwise

Where c is the value of the correlation and y is a positive threshold. The detection process is shown in Fig. 1(b). Watermarking techniques that are intended to be widely used must satisfy several requirements. The type of application decides which watermarking technique to be used. However, three requirements have been found to be common to most practical applications and the discussion below concentrates on these.

A. Watermark Imperceptibility

The watermark should be hidden in the media signal in such a way that it cannot be seen. However, watermark invisibility can conflict with other requirements such as robustness. Sometimes it is necessary to exploit the characteristics of the human visual system (HVS) or the human auditory system (HAS) in the watermarking embedding process. The

Fig 2 Zig-zag ordering for the JPEG model

watermark should also be statistically invisible. An unauthorized person should not be able to detect the watermark using statistical methods.

B. Robustness

The watermark should be detectable even if intentional or unintentional attacks are made on the watermarked image. If this is the case, then the watermark is robust. To achieve a high degree of watermark robustness, the watermark must be placed in significant parts of the media signal. In the case of image watermarking, resistance to geometric manipulations, such as translation, resizing, rotation, and cropping is still an open issue.

C. Detecting the Watermark

The probability of failing to detect the embedded watermark and detecting a watermark when, in fact, one does not exist, must be very small even after the media has been subjected to attacks or signal distortion. As a result, detection of the embedded watermark proves the ownership of the media signal.

It must be understood that the above requirements compete with each other. Different watermarking applications result in the corresponding design requirements. In any case, a watermarking technique should be widely accepted and used on a large, commercial scale, so that it might then stand up in a court of law.


Watermarking techniques are broadly divided into three categories - Spatial domain, Frequency Domain and Wavelet Domain.

Spatial Domain

To design a digital watermark in the spatial or temporal domains, these approaches need to modify the least significant bits (LSB) of the host data. These lowest order bits are visually insignificant, so the watermark will be invisible. After embedding it, the watermark is recovered using knowledge of the PN sequence and watermark location.

Frequency Domain

Frequency domain watermarking technique is also called transform domain. Values of certain frequencies are altered from their original. Typically, these frequency alterations are done in the middle frequency levels, since alternations at the higher frequencies are lost during compression and alternations in the lower frequency will cause a visible change. The watermark is applied to the whole image so as not to be removed during a cropping operation. However, there is a tradeoff with the frequency domain technique. Verification can be difficult since this watermark is applied indiscriminately across the whole image.

Wavelet Domain

Another possible domain for watermark embedding is that of the wavelet domain. The DWT (Discrete Wavelet Transform) separates an image into a lower resolution approximation image (LL) as well as horizontal (HL), vertical (LH) and diagonal (HH) detail components. The process can then be repeated to computes multiple "scale" wavelet decomposition, as shown in the figure.

Fig 3 2 Dimensional Discrete Wavelet Transform

One of the many advantages over the wavelet transform is that that it is believed to more accurately model aspects of the HVS as compared to the FFT or DCT. This allows us to use higher energy watermarks in regions that the HVS is known to be less sensitive to, such as the high resolution detail bands {LH,HL,HH). Embedding watermarks in these regions allow us to increase the robustness of our watermark, at little to no additional impact on image quality.


The classic and still most popular domain for image processing is that of the Discrete-Cosine-Transform, or DCT. The DCT allows an image to be broken up into different frequency bands, making it much easier to embed watermarking information into the middle frequency bands of an image. The middle frequency bands are chosen such that they have minimize they avoid the most visual important parts of the image (low frequencies) without over-exposing themselves to removal through compression and noise attacks (high frequencies).

The watermarking scheme we're following is based on the JPEG compression model. Initially the image is segmented and subdivided into blocks of size 8x8. After dividing the image, we take the DCT of each block. After transforming the image into frequency domain, the pixels are ordered using the zigzag scan which is used in JPEG compression.

Fig 4 Proposed watermarking scheme

The general equation for a 2D (N by M image) DCT is defined by the following equation:

\begin{displaymath} F(u,v) = \left(\frac{2}{N}\right)^{\frac{1}{2}} \left(\frac{... ...}(2i+1) \right]cos\left[ \frac{\pi.v}{2.M}(2j+1) \right].f(i,j)\end{displaymath}


\begin{displaymath} \Lambda(\xi) = \left\{ \begin{array} {ll} \frac{1}{\sqrt{2}} & {\rm for} \xi = 0 \ 1 & {\rm otherwise}\end{array} \right.\end{displaymath}

Here, a watermark consists of a binary image. The image consists of only black and white pixels with magnitude 0 and 1 respectively.

Fig 5.Binary Image Used

Once the DCT of the blocks is computed, we embed the watermark in the selected bits.

The watermark is added by replacing the DCT coefficients of the selected block using the equation

The robustness is determined by the DCT coefficients of the image which are being replaced.

Greater the robustness constant, greater will be the robustness of watermark. But as the magnitude of the robustness constant increases, the visibility of the watermark increases too.

Now, we need to reverse the above procedure to get the watermarked image. So the modified

DCT coefficients are reinserted into the zigzag scan.

The blocks which are obtained as the output of the zigzag scan are then subjected to Inverse Discrete Cosine Transform.

Following this the different blocks are merged to get the watermarked image.

In our proposed watermarking scheme, we do not water mark the entire image but instead every image segment of 8x8 pixels. Within each segment, only the coefficients of the middle frequencies are replaced. The middle frequency band, FM, is chosen as the embedding region as to provide additional resistance to lossy compression techniques, while avoiding significant modification of the cover image.

Fig 5 Definition of DCT Regions


The proposed algorithm with an original image (Fig 6.1) was executed many different number of times with different embedding conditions, such as pixel location where the watermark has to be embedded.

When the algorithm is executed with watermark embedded in the middle frequency, the watermarked image obtained is similar to the original image, without any visible changes. The watermark thus embedded is robust, as it cannot be detected and also it is not lost in case the image is compresses. (Fig 6.2)

When the algorithm is executed with watermark embedded in the low frequency band, the watermarked image obtained is distorted with highly visible changes in the original image. The watermark thus embedded is caught by the naked eye.(Fig 6.3)

When the algorithm is executed with watermark embedded in the high frequency band, the watermarked image does not exhibit any visible changes with respect to the original image. The robustness of this watermarking is very weak, as the watermark from the entire image can be lost if the image is compressed, hence rendering the image without any proof of its authenticity or ownership. (Fig 6.4)

Fig 6.1

Fig 6.2

Fig 6.3

Fig 6.4

The watermarked extracted in all the three cases, however is same and matches the embedded watermark.

In case of tampering with the image, for example if the image is cropped out and then tested for watermark, the watermark obtained is faulty and does not match the embedded watermark. (Fig 7)

Cropped Watermarked Image

Extracted Watermark