Visual Cryptography For Color Images Using Error Diffusion and Pixel Synchronization
Visual Cryptography For Color Images Using Error Diffusion and Pixel Synchronization
Visual Cryptography For Color Images Using Error Diffusion and Pixel Synchronization
Bharati Pannyagol
Department of Computer Science and Engineering
Gogte Institute of Technology, Belgaum, Karnataka
ABSTRACT-Visual Cryptography (VC) is not sufficient in terms of providing color meaningful
shares with high visual quality. This paper produces visual cryptography encryption method for
color images which use the error diffusion and visual information pixel (VIP) synchronization
techniques to generate meaningful color shares with high visual quality. Low frequency differences
between the input and output images are minimized in Error diffusion method and consequently it
produces pleasing halftone images to human vision. Synchronization of the VIPs across the color
channels improves visual contrast of shares. Comparison of Jarvis halftone with Floyd halftone
shows good result of Jarvis method.
KeywordsColor meaningful shares, halftoning, error diffusion, visual cryptography (VC).
I INTRODUCTION
Visual Cryptography (VC) is a data security technique which allows visual information (pictures, text, etc.)
to be encrypted in such a way that decryption operation does not require a computer. Visual Cryptography
(VC) for black and white was first formally introduced by Naor and Shamir [1]. In which one secret binary
image is cryptographically encoded into n shares of random binary patterns. The n shares are distributed
amongst group of n participants, one for each participant. No participants can retrieve any information from
his own transparency, but any k or more participants can visually reveal the secret image by polling there
transparencies together. The secret cannot be decoded by any k-1 or less participants, even if higher
computational power is available to them. In VC the decryption process requires only human visual system.
This property makes visual cryptography especially useful for the low computation load requirement.
VC scheme has been applied to many applications. Apart from the obvious applications to information
hiding, there are many applications of VC [2, 3], which include general access control [4]. VC can also be
used in a number of other applications such as threshold cryptography, electronic cash, private multiparty
computations and digital electronics etc.
ISSN: 2278-621X
Generally, the black-and-white (2, 2) visual cryptography decomposes every pixel in a secret image into a
22 block in the two transparencies according to the rules in figure 1, two of them black and white. If pixel
is white (black) one of the above six columns of figure 1 is chosen to generate Share1 and Share2. Then,
the characteristics of two stacked pixels are: black and black is black, white and black is black, and white
and white is white. Therefore, when stacking two transparencies the blocks corresponding to black pixels in
the secret image are full black and those corresponding to white pixels are half-black-and-half-white. As
concern to information security, one of the six columns is selected with equal probability.
Fig.2: Example of 2-out-of-2 scheme. The secret image is encoded into two shares showing random patterns. The decoded image
shows the secret image with 50% contrast loss.
Figure 2 shows an example of a simple (2, 2)-VC scheme with a set of subpixels shown in figure 1. Figure
2(a) shows a secret binary message, Figure 2(b) and (c) depict encrypted shares for two participants.
Stacking these two shares leads to the output secret message as shown in figure 2(d).
Little research has been carried out on VC, a more general method for VC scheme is based upon general
access structure [4]. The access structure is a specification of qualified and forbidden subsets of shares. The
participants in a qualified subset can recover the secret image while the participants in a forbidden subset
cannot. But this technique gives good result on binary images. In extended visual cryptography (EVC)[5]
method, a shares contain not only the secret information but are also some meaningful binary images are
developed. In this method Hypergraph colorings are used for constructing meaningful binary shares. Since,
hypergraph colorings are constructed by random pixels distribution, the resultant binary shares contain
strong white noise leading to insufficient results. A VCS for color images based upon an additive color
ISSN: 2278-621X
mixing [6] method is introduced. In this scheme, each pixel is expanded by a factor of three, which will
increase the size of encrypted shares.
This paper introduces a color VC encryption method to generates meaningful shares. It based on two
fundamental concepts used in the generation of shares they are error diffusion[7] and pixel
synchronization[8]. Error diffusion is a procedure that produces pleasing halftone images to human vision.
Synchronization of the pixels of secret image and covering images across the color channels improves
visual quality of shares. Visual Information Pixel (VIP) synchronization prevents colors and contrast of
original shares from degradation even with matrix permutation.
This paper is organized as follows. Section II describes the proposed method which uses Error diffusion
and VIP Synchronization. Section III shows experimental results of the new method and comparisons of
Error diffusion methods. Finally, we conclude this paper in Section IV.
II . IMPLEMENTATION
System is designed into 2 phases. The first phase generates shares by using the error diffusion [11]
algorithm and Pixel Synchronization. The Figure 3 explains the working of the system.
N covering
Share Generation
Halftoning
Secret Img
VIP
synchronization
Secret image
Stacking
A. Halftoning
Error diffusion [7],[9] produces halftone images of much higher quality than other halftone. It quantifies
each pixel using a neighborhood operation. A schematic diagram of error diffusion method is given in
figure 4. The error diffusion scans the image one row at a time and one pixel at a time. The current pixel is
compared to a threshold (127) value. If it is above the value a white pixel is generated in the resulting
image. If the pixel is below the half way value, a black pixel is generated. The generated pixel is either full
bright, or full black.
ISSN: 2278-621X
Fig.5: Two error diffusion weight matrixes (a) Jarvis, Judice, and Ninke (b) Floyd and Steinberg
Error is calculated which is the difference between original image and halftone image. The error is
then added to the next pixel in the image and the process repeats. To which neighbor and how this error is
pushed is decided by an error diffusion matrix.
Algorithm: Jarvis error diffusion halftoning
1: procedure JARVIS ERROR DIFFUSION (g)
2: for i=1,..n do
3:
for j=1,.m do (This algorithm goes through all pixels in the original image,
normally starting from the pixel up to the left and then goes through all pixels from left to right
and up down).
4:
5:
6:
Since the pixel value in f, which is a real number between 0 and 255, has been replaced
by 0 or 1 in b and error has been calculated.
e= f
- b(i,j)
The error is the difference between the pixel value in f and b at that position.
The error occurred at the position (i, j) is weighted by 7/48 and added to the pixel value at
(i+1, j). The same error is weighted by 5/48 and added to the pixel at (i+1, j+1) and so on.
After the error has been diffused the pixel value of the next position is compared to the threshold
and the same process continues until all pixels have been met.
7:
end for 8:
end for
9: end procedure
Floyd and Steinberg error diffusion method follow the same algorithm except that while distributing error
it uses Floyd and Steinberg matrix as shown in figure 5(b).
B.VIP Synchronization
ISSN: 2278-621X
Visual Information Pixel (VIP) is pixel on the encrypted shares that have color values of the original
images, which make shares meaningful. In the proposed method each subpixel n carries visual information
as well as message information ,while other methods in [1] and [5] extra pixels are needed in addition to
the pixel expansion n to produce meaningful shares.
Algorithm: VIP synchronization
Input: C1, C2 covering Images of size n x m, Sc secret image of size K1xK2.
Output: 2 meaningful shares
1: procedure: VIP Synchronization and Matrix Distribution
2: for p=1,..K1 and for q=1,K2 do
3:
for the color channel R of the secret image ScR(p,q) do
4:
if the bit ScR(p,q)=1 then
for i=1,..K1 do for j=1,.K2 do
if C1(i,j)=C2(i,j) then
Randomly select any one Ci and complement Ci(i,j)
end if
5:
end for
end for
6:
else if ScR(p,q)=0 then
for i=1,..K1 do
for j=1,.K2 do
if C1(i,j)
then
Randomly select any one
Ci and make them equal i.e.C1(i,j)=C2(i,j) or
C2(i,j)= C1(i,j)
end if
end for end for
end if
7: Repeat 3 to 6 for the channel G and Y.
8: end for 9: end for
10: end procedure
This algorithm takes the input as halftone images which are created by error diffusion method. It
decomposes the color images into 3 basic colors (Red, Green, and Blue) and then it executes VIP
Synchronization algorithm on each color bit. The output of this block are meaningful shares. Now each bit
on share contains information regarding covering image as well as secret image without giving any clue
about encryption.
C. Stacking
Decoding does not need any algorithm. The meaningful shares are XORed to reconstruct the secret image
by simply human vision system.
A. Results
In this section, we provide some experimental results to illustrate the effectiveness of the proposed method.
Example are composed with (2, 2) Color VC, (2,3) Color VC and (3,4) color VC. The secret message of
size 128x128 pixels and covering images of size 256x256 in natural colors are provided for the share
ISSN: 2278-621X
generation. Figure 6 to 10 represent the results of each step of the system. Size of images is resized to fit in
the paper.
(a)
(b)
(c)
(d)
Fig.6 (a) (d) Covering Input Images of size 256x256 (e) secret input image of size 128x128
(a)
(b)
(c)
(e)
(d)
(e)
Fig.7 Halftone shares using error diffusion method
All the images are halftone before encryption process. Halftone images create a space so that we can embed
secret message into covering image.
A. (2, 2) Visual Cryptography
(a)Share 1
(b) Share 2
Fig 8 (a)-(b) result of encrypting images (a),(b) and (e) of figure 7. fig.8 (c) Result of stacking (a) and (b) of figure 8.
ISSN: 2278-621X
(a)Share1
(b) Share 2
(c) Share 3
image
Fig 9 (a)-(c) Result of encrypting images (a),(b) ,(c)and (e) of figure 7.fig 9 (d) Result of stacking (a),(b) and (c) of figure 9
(a) Share1
(b) Share2
(c) Share3
(d) Share4
Fig.10 (a)-(d) Result of encrypting images (a),(b) ,(c),(d) and (e) of figure 7.fig.10 (e) Result of stacking (a),(b) ,(c)and (d)
of figure 10
B .Analysis
Table-I,II and III shows the result of 4 sample images of different categories for Jarvis[13] and Floyd and
Steinberg[8] error diffusion algorithm for (2,2) ,(2,3) and (2,4) VC schemes ,respectively.
TABLE I: PSNR AND CORRELATION PARAMETERS USED FOR DIFFERENT IMAGES AND HALF TONE
METHODS FOR 2 SHARES.
Image
Parameter Floyd-Steinberg method Jarvis method
Letter img
Map Img
Chi Img
Logo Img
PSNR
Correlation
PSNR
Correlation
PSNR
Correlation
PSNR
Correlation
84.9575
0.974538
71.7093
0.81175
77.8475
0.960843
75.4791
0.950232
Fig.11 (a) Different images versus PSNR with different halftone methods
89.3672
0.99192
79.246
0.986
82.1807
0.990318
78.7595
0.981658
ISSN: 2278-621X
Figure 11 (a) shows the PSNR values for the sample images. Stacked image produced by Jarvis [13] is very
good retains pictorial details as compared to Floyd and Steinberg [8] half tone method. Since, Jarvis
halftone method give clearer image compared to Floyd and Steinberg halftone method. Figure 11 (b) shows
the correlation values for the sample images. Reconstructed image produced by Jarvis [13] is very much
similar to original image as compared to Floyd and Steinberg [8] halftone method. This means there is very
small amount of data loss in Jarvis halftone method.
TABLE II: PSNR AND CORRELATION PARAMETERS USED FOR DIFFERENT IMAGES AND HALF TONE
METHODS FOR 3 SHARES.
Image
Parameter Floyd-Steinberg method Jarvis method
Letter img
Map Img
Chi Img
Logo Img
PSNR
78.8211
76.0964
Correlation
0.891287
0.825342
PSNR
71.2261
74.2355
Correlation
0.872098
0.971221
PSNR
73.8673
75.1725
Correlation
0.935264
0.95069
PSNR
74.5543
74.4709
Correlation
0.929823
0.91969
Figure 12 a) and b) shows the PSNR and correlation values for the sample images, respectively. Jarvis
halftone method produce clearer image compared to Floyd and Steinberg halftone method. If less
information is present secret image then in (2,3) VC Floyd and Steinberg provide clear picture compared to
Jarvis.
TABLE III: PSNR AND CORRELATION PARAMETERS USED FOR DIFFERENTIMAGES AND HALF TONE
METHODS FOR 4 SHARES.
Correlation
0.142009
0.742706
PSNR
65.4256
65.9732
Correlation
0.0236446
0.480244
PSNR
66.1038
67.4695
Correlation
0.184984
0.701278
PSNR
66.9184
70.5797
Correlation
0.101503
0.65802
Parameter
Letter
img
Map Img
Chi Img
Logo Img
Jarvis method
PSNR
Floyd-Steinberg
method
66.8975
Image
74.0314
ISSN: 2278-621X
Fig.13 (a) Different images versus PSNR with different halftone methods
images
Figure 13(a) and (b) shows the PSNR and correlation values for the sample images, respectively for (2,4)
VC. Jarvis halftone method produce clearer image compared to Floyd and Steinberg halftone method.
TABLE IV
PSNR PAMETERS USED FOR DIFFERENT IMAGES
AND NO.OF SHARES GENERATED
Images
Letter img
2 Shares
89.3672
3 Shares
76.0964
4 Shares
74.0314
Map Img
79.2460
74.2355
65.9732
Chi Img
82.1807
75.1725
67.1217
Logo Img
78.7595
74.4709
70.5797
Figure 14 shows PSNR value for different VC scheme. Stacked image of (2,2) VC scheme is very good
retains pictorial details as compared to another two VC schemes. As we increase the number of covering
images performance of Synchronization process is less. As the security point of view (2,2) has more
security ratio compared to (2,3) and (2,4) VC.
IV. CONCLUSION AND FUTURE WORK
The proposed system presents an encryption method for color Visual Cryptography scheme with Error
diffusion and VIP Synchronization for visual quality improvement. Jarvis and Floyd and Steinberg halftone
methods are compared. Jarvis kernel gives better visual quality. For encryption VIP synchronization is
used. It hold the original pixels in the actual VIP values to produce meaningful shares. The secret
information is revealed by overlapping of meaningful shares.
V. REFERENCES
[1]
M. Naor and A. Shamir, Visual cryptography, in Proc. EUROCRYPT, 1994, pp. 112.
[2]
M. S. Fu and O. C. Au, Joint visual cryptography and watermarking, in Proc. IEEE Int. Conf. Multimedia Expo, 2004, pp.
975978.
[3]
M. Naor and B. Pinkas, Visual authentication and identification, Adv.Cryptol., vol. 1294, pp. 322336, 1997.
[4]
G. Ateniese, C. Blundo, A. D. Santis, and D. R. Stinson, Visual cryptography for general access structures, Inf. Comput., vol.
129, no. 2, pp. 86106, 1996.
ISSN: 2278-621X
[5]
G. Ateniese, C. Blundo, A. Santis, and D. R. Stinson, Extended capabilities for visual cryptography, ACM Theor. Comput.
Sci., vol. 250,pp. 143161, 2001.
[6]
C. N. Yang and T. S. Chen, Visual cryptography scheme based on additive color mixing, Pattern Recognit.,vol. 41, pp. 3114
3129, 2008.
[7]
[8] InKoo Kang,Gonzalo R.Arce,heung-Kyu Lee, Color Extended Visual Cryptography Using Error Diffusion, IEE Trans. On
Image processing,vol.20.no.1.2.11
[9] Sadan Ekdemir, Xunxun Wu, Digital Halftoning Improvements on the Two-by-Two Block Re-placement Method.333,jan
2011.
10
ISSN: 2278-621X