1 Introduction

Visual cryptography is an innovative domain of cryptography that combines the power of encryption with the visual representation of information. Ever since the technology confronted the need to transfer digital data, securing it with reliable techniques were pursued. Traditional cryptographic methods were evolved so as to manipulate on texts or numerical data. Further inventions were made using the visual elements like images and patterns. This niche domain of cryptography in which encryption is done using the visual representation of information is termed as Visual Cryptography Scheme (VCS). The techniques in visual cryptography are widely used today where privacy and confidentiality are of great significance. Visual cryptography has practical applications in secure communications, document authentication and watermarking allowing sensitive information to be shared and verified through multiple image shares. However, it faces challenges such as pixel expansion, ensuring high quality reconstructed images and managing color image processing. The fundamental idea of VCS was explained by Naor and Shamir [1] in 1994. Since then, it invited a great attention of many researchers from different domains such as image authentication, watermarking and information security. The overview of visual cryptography is to split an image into parts called shares and any individual share does not suffice to retrieve the secret image [2]. The individual shares are then distributed to different shareholders. The secret image can be recouped when the shares are combined together by stacking.

Visual cryptography is a method in which a secret image is shared within a group of shareholders. The image which is the secret is entrusted with group members as unusable fragments. Unlike conventional cryptographic techniques that rely on complex algorithms and secret keys, visual cryptography does not require any cryptographic expertise to retrieve the original image. This makes it applicable for scenarios where users may have limited technical knowledge.

A (k, n) VCS involves splitting up of a secret image into n parts. The reconstruction of the secret image becomes feasible when a minimum of k segments are combined. However, if less than k segments are involved, the reconstructed image will be meaningless and insignificant. Decoding is achieved by the Human Visual System (HVS) without requiring intricate computations. This feature is widely regarded as the foremost advantage of VCS [3]. The conventional VCS have the following drawbacks: (i) pixel expansion (ii) complex codebook design (iii) change in aspect ratio [4].

Kafri and Keren [5] pioneered the encryption of binary images by Random Grid Visual Cryptography Scheme (RGVCS) in 1987. A binary image is split into two random parts such that they have same dimension as that of the binary image. RGVCS can also be used for generating master share and private share for each participant to enhance the security and confidentiality [6]. It exceeds conventional VCS by preserving the secret image’s original size, effectively eliminating the issue of pixel expansion. This paper reviewed and analysed existing (k, n) random grid algorithms with different values of threshold.

2 Random grid visual cryptography scheme

This section gives some definitions and a concise overview of traditional RGVCS. Consider ⊕ as OR and ⊗ as XOR. In order to encrypt a binary secret image, S of dimension M x N with S (i, j), 1 ≤ i ≤ M, 1 ≤ j ≤ N, is allotted to n shares S1, S2, S3,….,Sn and from t (1 ≤ t ≤ n) shares the secret image S’ is retrieved. Kafri and Keren [5] described random grid as a 2-D array of pixels that is formed as whether the pixels are transparent or not. There is an equal chance of having transparent or opaque pixels as the decision is made using a coin-flip method [5]. For example, consider a pixel b within a randomly generated grid R. The likelihood of b being transparent is the same as the likelihood of it being opaque. Prob (b = 0) = 1/2 = Prob (b = 1), where b = 0 indicates transparent and b = 1 means opaque. The light transmission of b is denoted as £(b) = 1/2.

Consider S1 and S2, two standalone random grids with same size, s1 ∈ S1 and s2 ∈ S2 where s1 and s2 are in same position of S1 and S2. When these two random pixels s1 and s2 are superimposed with OR, only four combinations are possible. For s1 ⊕ s2 being transparent, the probability is 1/4. Since S1 and S2 are superimposed, the average light transmission of S1 and S2 (s1 and s2) is 1/4. £( s1 ⊕ s2) = 1/4 and ( £(S1 ⊕ S2) = 1/4).When \(\overline{b}\) is a complement of b, b ⊕\(\overline{b}\)=1Prob (b ⊕\(\overline{b}\)= 0) = 0. Therefore £(b ⊕ \(\overline{b}\)) = 0 or £(S ⊕ \(\overline{S}\)) = 0.

Definition 1

(Average light transmission): The light transmission of a transparent (resp. opaque) pixel is expressed as £(b) = 1 (resp. 0) for a specific pixel b in a binary image S of size M x N. Overall, the general average light transmission of S is described as [7,8].

$$\pounds\left( {S \, } \right) = \frac{{\mathop \sum \nolimits_{i = 1}^{M} \mathop \sum \nolimits_{j = 1}^{N} \pounds\left( {S\left( {i,j} \right)} \right)}}{MXN}$$
(1)

Definition 2

(Contrast): The contrast (\(\alpha )\) between the original image S and the recovered binary image S’ is defined as [7,8]

$$\alpha = \frac{{\pounds( S^{\prime}\left[ {S\left( 0 \right)} \right] - \pounds( S^{\prime}\left[ {S\left( 1 \right)} \right]}}{{1 + \pounds( S^{\prime}\left[ {S\left( 1 \right)} \right]}}$$
(2)

Three algorithms were introduced by Kafri & Keren [5] to generate two meaningless random shares S1 and S2. Random_GridAlg1 is considered to be better while contrast and light transmission are considered[7]. In encoding, S1 is created by choosing the values from normal distribution. Concurrently, the value of a specific pixel in S2 is decided by the value of respective pixel in the secret image. If the value is transparent, then S1 and S2 have the same value; or else they have complementary values. The resultant grid S1 ⊕ S2 always yields 1 when the pixel of S is black, and it has a partial probability of being transparent or opaque when the pixel of S is white. Kafri and Keren’s [5] algorithms are explained in detail.

figure a

The recovered images using the above algorithms are shown in Fig. 1. The equations for finding Mean Squared Error (MSE), Peak Signal-to-Noise Ratio (PSNR) and Structured Similarity Index Measure (SSIM) are given.

$${\text{MSE}} = \frac{1}{mn}\mathop \sum \limits_{i = 0}^{m - 1} \mathop \sum \limits_{j = 0}^{n - 1} \left[ {I\left( {i,j} \right) - K\left( {i,j} \right)} \right]^{2}$$
(3)

where m and n represents the dimensions of the images, I denotes the original image, and K signifies the distorted image.

$${\text{PSNR}} = {1}0 - {\text{log1}}0\left( {\frac{{MAX^{2} }}{MSE}} \right)$$
(4)

where MAX represents the highest possible pixel value in the image.

$${\text{SSIM}}({\text{a,b}})\frac{{\left( {2{\upmu }_{a} {\upmu }_{b} + { }C_{1} } \right)\left( {2\sigma_{ab} + C_{2} } \right)}}{{\left( {{\upmu }_{a}^{2} + {\upmu }_{b}^{2} + C_{1} } \right)\left( {\sigma_{a}^{2} + \sigma_{b}^{2} + C_{2} } \right)}}$$
(5)

where µa is the mean of a, µb is the mean of b.

Fig. 1
figure 1

Reconstructed images proposed by Kafri & Keren [5]

σ2a and σ2b are the variances of a and b.

σab is the covariance between a and b.

C1 = (k1L)2 and C2 = (k2L)2 are constants. PSNR and SSIM values for the above algorithms are given in Table 1.

Table 1 PSNR & SSIM

Despite the superiority of RGVCS over traditional VCS, the former received less attention until Shyu extended the schemes [3,8]. Chen and Tsao [7,10] presented (n, n) and (2, n) schemes for binary and color images.

Random_Grid (S, n) demonstrates the (n, n) scheme in which Random_Grid() can be substituted by Random_GridAlg1, Random_GridAlg2 or Random_GridAlg3. Rand_Perm() randomly shuffles and assigns the generated bits to the output shares.

figure b

3 Recent research advances in (k, n) random grid schemes

Chen and Tsao [9] extended the basic VCS techniques of (2, 2) by Kafri and Keren [5], (2, n) and (n, n) by Chen & Tsao [7,10], Shyu [3,8] to (k, n) VCS. The shareholders should provide no less than k individual shares to get back the secret. Fewer than k shares produce meaningless superimposed image. Calculations are also done to determine the theoretical contrast of the superimposed result. The feasibility of the suggested method is demonstrated by simulating (2, 4) and (3, 4) schemes for both binary and color images.

Wu and Sun [11] extended Chen and Tsao’s method [9] to obtain a contrast-improved VCS on random grids and presented a void and cluster based post-processing to increase the uniformity of the recovered image. The visual quality of the retrieved image is increased by using the recommended schemes. Optimal contrast is attained by the contrast- improved RGVCS and an improved image can be recovered by using the post-processing techniques.

Lee et al. [12] presented quality-improved random grid based VCS scheme which outperforms Chen & Tsao’s (k, n) algorithm [9] as its visual quality is a concern. Rather than arbitrarily generating n-k pixels, they are selected from the generated k pixel values. Further investigations and findings of contrast proved that the proposed algorithm surpasses the existing techniques.

A unique (k, n) RG-based VCS proposed by Guo et al. [13] enhances the contrast of Chen and Tsao’s algorithm [9], thereby increases the visual quality. However, the values of k and n do not accurately describe the scheme’s contrast. The experiments and results showed the superiority of this approach over Chen and Tsao’s scheme.

Liu et al. [14] presented a (k, n) threshold VCS based on random grids, which has improved visual quality when compared to Wu and Sun’s [11] and Guo et al.’s [13] algorithms. This paper analysed the features that determine the visual quality and utilized the generated bits to improve the parameters. The feature of attaining improved contrast causes this algorithm to be applied for other domains also.

Yan et al. [15] introduced a novel VCS threshold scheme in which multiple decryptions based on OR and XOR are considered. The original image can be fully recuperated if there is a machine having XOR operation is available. The image can also be retrieved with good quality by HVS without any complex cryptographic algorithms when minimum number of shares is available for (k, n) VCS scheme. Several experiments were performed to assess the effectiveness of the recommended scheme.

Hu et al. [16] introduced a contrast enhanced scheme for (k, n) VCS based on random grids and a common equation for calculating theoretical contrast with better accuracy. It was inferred that there is some relationship between the first k pixels and the contrast. As a result, using the initial k pixels, it is possible to produce the final n-k pixels. Theoretical study and findings from the experiments indicates that the suggested method has improved visual quality and higher value of contrast than the existing threshold techniques.

Zhao and Fu [17] developed a new contrast enhanced (k, n) VCS based on OR and XOR decryptions. A common formula to calculate the value of theoretical contrast is also mentioned in the paper. The recommended scheme is using the parity basis matrices and hence there is no pixel expansion. When suitable computing devices are available, an XOR procedure can completely recoup the original image. Further investigations and studies guaranteed the efficiency and security of the method.

4 Implementation and analysis of (k, n) random grid schemes

We have implemented different (k, n) VCS techniques based on random grids using Python. Evaluation parameters such as theoretical contrast (α), experimental contrast (τ) and visual quality are considered to validate the efficiency of each algorithm. A binary image S of size M x N is the input to Algorithms 1–8 and n random grids S1, S2,…..,Sn of the same size are generated. The different schemes are two-out-of-two, two-out-of-n, n-out-of-n and k-out-of-n. This paper reviewed and analysed (k, n) algorithms of various researchers during 2011 to 2022.

Input: Secret image S.

Output: random grids S1, S2,…..,Sn.

figure c

Algorithm 1

The theoretical contrast for the algorithm is given by the equation

$$\alpha = \frac{{2*tC_{k} }}{{\left( {2^{t} + 1} \right)nC_{k} - tC_{k} }}{\text{where }}k \, \le \, t \, \le \, n$$
(6)

For (3, 5), \({ }t = 3 \to \alpha = \frac{{2*3C_{3} }}{{\left( {2^{3} + 1} \right)5C_{3} - 3C_{3} }} = \frac{2}{89} = 0.0225\)

$${ }t = 4 \to \alpha = \frac{{2*4C_{3} }}{{\left( {2^{4} + 1} \right)5C_{3} - 4C_{3} }} = \frac{8}{116} = \, 0.0{482}$$
$${ }t = 5 \to \alpha = \frac{{2*5C_{3} }}{{\left( {2^{5} + 1} \right)5C_{3} - 5C_{3} }} = \frac{1}{16} = \, 0.0{625}$$

Algorithm 1[9] makes use of the basic algorithm to generate k bits and the rest of n-k bits are arbitrarily chosen from normal distribution. By randomly rearranging and permuting n bits, n shares are obtained. The theoretical contrast for (2, 4) scheme is 0.0690, 0.1176, 0.125 for t = 2, 3, 4 respectively and for (3, 5) scheme the value is 0.0225, 0.0482, 0.0625 for t = 3, 4, 5 respectively.

figure d

Algorithm 2

The theoretical contrast for the algorithm is given by the equation

$$\alpha = \left\{ {\begin{array}{*{20}l} {(\frac{1}{2})^{k - 1} for t = n} \\ {\frac{{\left( {\begin{array}{*{20}c} {n - k + 1} \\ {t - k + 1} \\ \end{array} } \right)(\frac{1}{2})^{k - 1} }}{{\left( {\begin{array}{*{20}c} n \\ t \\ \end{array} } \right) + A.B.D}} otherwise } \\ \end{array} } \right.$$
(7)
$$where~~A = \left\{ {\begin{array}{*{20}c} {\left[ {\left( {\begin{array}{*{20}c} {k - 1} \\ {q - n + k - 1} \\ \end{array} } \right),.......,\left( {\begin{array}{*{20}c} {k - 1} \\ {k - 1} \\ \end{array} } \right)} \right]} & {for~n - k + 1 \le q < n} \\ {\left[ {~\left( {\begin{array}{*{20}c} {k - 1} \\ 0 \\ \end{array} } \right),.........,~\left( {\begin{array}{*{20}c} {k - 1} \\ {k - 1} \\ \end{array} } \right)} \right]} & {otherwise} \\ \end{array} } \right.$$
$$B = \left\{ {\begin{array}{*{20}c} {\left[ {\left( {\begin{array}{*{20}c} {n - k + 1} \\ {n - k + 1} \\ \end{array} } \right), \ldots \ldots .,\left( {\begin{array}{*{20}c} {n - k + 1} \\ {q - k + 1} \\ \end{array} } \right)} \right]} & {for~n - k + 1 \le q < n} \\ {\left[ {~\left( {\begin{array}{*{20}c} {n - k + 1} \\ q \\ \end{array} } \right), \ldots \ldots \ldots ,~\left( {\begin{array}{*{20}c} {n - k + 1} \\ {q - k + 1} \\ \end{array} } \right)} \right]} & {otherwise} \\ \end{array} } \right.$$
$$D = \left\{ {\begin{array}{*{20}c} {\left[ {(\frac{1}{2})^{{q - n + k}} ,.......,(\frac{1}{2})^{{k - 2,~~~}} ,~~~(\frac{1}{2})^{{k - 1}} ,0} \right]} & {for~n - k + 1 \le q < n} \\ {\left[ {~\frac{1}{2},...... \ldots ..,(\frac{1}{2})^{{k - 2}} ,~(\frac{1}{2})^{{k - 1}} ~,0} \right]} & {otherwise} \\ \end{array} } \right.$$

For (3, 5), \(t = 3 \to \alpha = \frac{{\left( {\begin{array}{*{20}l} {n - k + 1} \\ {t - k + 1} \\ \end{array} } \right)(\frac{1}{2})^{k - 1} }}{{\left( {\begin{array}{*{20}c} n \\ t \\ \end{array} } \right) + A.B.D}} = \frac{{\left( {\begin{array}{*{20}c} 3 \\ 1 \\ \end{array} } \right)(\frac{1}{2})^{2} }}{{\left( {\begin{array}{*{20}c} 5 \\ 3 \\ \end{array} } \right) + A.B.D}} = \frac{1}{16} = 0.0{625}\)

$$t = 4 \to \alpha = \frac{{\left( {\begin{array}{*{20}l} {n - k + 1} \\ {t - k + 1} \\ \end{array} } \right)(\frac{1}{2})^{k - 1} }}{{\left( {\begin{array}{*{20}c} n \\ t \\ \end{array} } \right) + A.B.D}} = \frac{{\left( {\begin{array}{*{20}c} 3 \\ 2 \\ \end{array} } \right)(\frac{1}{2})^{2} }}{{\left( {\begin{array}{*{20}c} 5 \\ 4 \\ \end{array} } \right) + A.B.D}} = \frac{3}{22} = 0.{1364}$$
$$t = 5 \to \alpha = (\frac{1}{2})^{k - 1} = \frac{1}{4} = 0.{25}$$

In Algorithm 2 [11], the first k-1 bits are arbitrarily chosen from normal distribution. rk is generated by performing XOR with S(i, j) and r1, r2,….rk. The rest of n-k bits are computed by assigning rk to rk+1, rk+2,… rn. The n bits are shuffled and rearranged to obtain the random grids. The theoretical contrast obtained for (2, 4) scheme is 0.2, 0.333, 0.5 for t = 2,3,4 and for (3, 5) scheme the value is 0.0625, 0.1364, 0.25 for t = 3,4,5 respectively.

figure e

Algorithm 3

The theoretical contrast for the algorithm is given by the equation

$$\alpha = \frac{1}{{2^{k - 1} }}*\frac{t - k + 1}{{n - k + 1}}$$
(8)

For (3, 5), \({ }t \, = \, 3 \to \alpha = \frac{1}{{2^{3 - 1} }}*\frac{3 - 3 + 1}{{5 - 3 + 1}} = \frac{1}{2} = \, 0.0{833}\)

$$t = 4 \to \alpha = \frac{1}{{2^{3 - 1} }}*\frac{4 - 3 + 1}{{5 - 3 + 1}} = \frac{1}{6} = \, 0.{1666}$$
$${ }t \, = \, 5 \to \alpha = \frac{1}{{2^{3 - 1} }}*\frac{5 - 3 + 1}{{5 - 3 + 1}} = \frac{1}{4} = \, 0.{25}$$

Algorithm 3 [12] generates k bits by Random_Grid1(S (i, j), k, n) and the rest of n-k bits are randomly chosen from r1, r2,….,rk. The n bits are randomly reorganised and distributed to obtain n grids. The calculated theoretical contrast is 0.1666, 0.333, 0.5 for t = 2,3,4 in (2, 4) scheme and 0.0833, 0.1666, 0.25 for t = 3,4,5 in (3, 5) scheme.

figure f

Algorithm 4

In Algorithm 4[13], k bits are generated by the basic algorithm and repeat [n/k] times to obtain k * [n/k] bits. The rest of the n—k * [n/k] bits are arbitrarily chosen from normal distribution. These bits are shuffled and distributed to produce n shares. For k > n/2, this method works same as Chen & Tsao’s method. For (k, n) scheme, when k ≤ n/2, this method improves the contrast of Chen & Tsao’s scheme. The value of theoretical contrast is 0.1427, 0.2499, 0.2499 respectively for t = 2,3,4 in (2, 4) scheme and 0.0224, 0.0480, 0.0622 respectively for t = 4,5,6 in (4, 6) scheme.

figure g

Algorithm 5

In Algorithm 5 [14], k bits are generated by Random_Grid1(S (i, j), k, n) and the remaining.

n—k bits are computed by assigning rk+1 = r1, rk+2 = r2,….,r2k = rk, r2k+1 = r1. These n bits are randomly reordered and allotted to n shares. The theoretical contrast is 0.2873, 0.5018, 0.5018 for t = 2,3,4 and 0.0854, 0.1889, 0.2485 for t = 3,4,5 in (2, 4) and (3, 5) schemes respectively.

figure h

Algorithm 6

The theoretical contrast for the algorithm is given by the equation

$$\alpha = \left\{ {\begin{array}{*{20}l} {\frac{{~2*tC_{k} }}{{\left( {2^{t} + 1} \right)nC_{k} - tC_{k} }},~} \hfill & {for\,~k \le t < n~\,or~\,n = k} \hfill \\ {\frac{1}{{2^{{n - 2}} }},~} \hfill & {for\,~k < n~\,and\,~t = n} \hfill \\ \end{array} } \right.$$
(9)

For (3, 5) \({ }t \, = \, 3 \to \alpha = \frac{{2*3C_{3} }}{{\left( {2^{3} + 1} \right)5C_{3} - 3C_{3} }} = \frac{2}{89} = \, 0.0{225}\)

$${ }t \, = \, 4 \to \alpha = \frac{{2*4C_{3} }}{{\left( {2^{4} + 1} \right)5C_{3} - 4C_{3} }} = \frac{8}{116} = \, 0.0{482}$$
$${ }t \, = \, 4 \to \alpha = \frac{1}{{2^{n - 2} }} = \frac{1}{8} = \, 0.{125}$$

Algorithm 6 [15] generates k bits by Random_Grid1(S (i, j), k, n) and n—k bits are randomly generated by normal distribution if n > k. If S(i, j) = r1 ⊕ r2 ⊕ ….. ⊕ rn, randomly rearrange the bits to get n shares or else randomly select p from k + 1, k + 2,….,n and then flip values of rp to ~ rp. Then rearrange and distribute the values to n shares. The value of theoretical contrast is 0.0689, 0.1176, 0.25 for t = 2,3,4 in (2, 4) and 0.0225, 0.0482, 0.125 for t = 3,4,5 in (3, 5) respectively.

figure i

Algorithm 7

The theoretical contrast for the algorithm is given by the equation

$$\alpha = \frac{{Prob_{k} *(\frac{1}{2})^{{k - 1}} }}{{1 + \mathop \sum \nolimits_{{w = 1}}^{{k - 1}} Prob_{w} ~*(\frac{1}{2})^{w} }}\;{\text{where}}\;1{\text{ }} \le {\text{ }}w{\text{ }} \le {\text{ }}k{\text{ }} \le {\text{ }}t{\text{ }} \le {\text{ }}n$$
(10)

For (3, 5), r1, r2, r3, r4, r5 are split into three groups GP1 = {r1, r4}, GP2 = {r2, r5}, GP3 = {r3}, where r1 = r4 and r2 = r5. For computing Probw with w = 3, t = 3, the probability of getting t pixels from any of w groups determines the result. The permitted groups of chosen pixels are {r1, r2, r3}, { r1, r5, r3}, { r4, r5, r3}, {,r4, r5, r3} the total is 4. There are 5C3 = 10 possible combinations with 3 pixels. As a result, the value of Probw=3 is 4/10 = 2/5. Similarly Probw=2 is 3/5. Combining 3 shares, theoretical contrast, \(\alpha = \frac{{\left( {\frac{2}{5}} \right)^{1} *\left( {\frac{1}{2}} \right)^{2} }}{{1 + \left( {\frac{3}{5}} \right)*\left( {\frac{1}{2}} \right)^{2} }} = \frac{2}{{23}} = 0.0870\)

Algorithm 7 [16] generates k—1 bits randomly from normal distribution and rk by performing XOR operation with S(i, j) and r1, r2,….rk-1. The rest of the n-k bits are generated by rk+1 = S(i, j) ⊕ rk ⊕ rk-1 ⊕ …… ⊕ r2 and rn = S(i, j) ⊕ rn-1 ⊕ rn-2 ⊕ …… ⊕ rn-k+1. Rearrange the n bits and then allotted to n shares. The theoretical contrast is 0.2857, 0.5, 0.5 for t = 2,3,4 and 0.0870, 0.1905, 0.25 for t = 3,4,5 in (2, 4) and (3, 5) schemes respectively.

figure j

Algorithm 8

The theoretical contrast for the algorithm is given by the equation

$$\alpha = \frac{{\frac{{\left( {\begin{array}{*{20}c} {n - k} \\ {t - k} \\ \end{array} } \right)}}{{\left( {\begin{array}{*{20}c} n \\ t \\ \end{array} } \right)}}{*}\frac{1}{{2^{k - 1} }}}}{{1 + \mathop \sum \nolimits_{{max\left\{ {0,t + k - n} \right\} \le g < k}} \frac{{\left( {\begin{array}{*{20}c} k \\ g \\ \end{array} } \right)\left( {\begin{array}{*{20}c} {n - k} \\ {t - g} \\ \end{array} } \right)}}{{\left( {\begin{array}{*{20}c} n \\ t \\ \end{array} } \right)}} * \frac{1}{{ 2^{g} }}}}$$
(11)

For (3, 5), \({ }t \, = \, 3 \to \alpha = \frac{{\frac{{\left( {\begin{array}{*{20}c} 2 \\ 0 \\ \end{array} } \right)}}{{\left( {\begin{array}{*{20}c} 5 \\ 3 \\ \end{array} } \right)}}{*}\frac{1}{{2^{2} }}}}{{1 + { }\sum \frac{{\left( {\begin{array}{*{20}c} 3 \\ 1 \\ \end{array} } \right)\left( {\begin{array}{*{20}c} 2 \\ 2 \\ \end{array} } \right)}}{{\left( {\begin{array}{*{20}c} 5 \\ 3 \\ \end{array} } \right)}} * \frac{1}{{ 2^{1} }} + \frac{{\left( {\begin{array}{*{20}c} 3 \\ 2 \\ \end{array} } \right)\left( {\begin{array}{*{20}c} 2 \\ 1 \\ \end{array} } \right)}}{{\left( {\begin{array}{*{20}c} 5 \\ 3 \\ \end{array} } \right)}} * \frac{1}{{ 2^{2} }}}} = \frac{1}{52} = 0.0{192}\)

$${ }t \, = \, 4 \to \alpha = \frac{{\frac{{\left( {\begin{array}{*{20}c} 2 \\ 1 \\ \end{array} } \right)}}{{\left( {\begin{array}{*{20}c} 5 \\ 4 \\ \end{array} } \right)}}{*}\frac{1}{{2^{2} }}}}{{1 + { }\frac{{\left( {\begin{array}{*{20}c} 3 \\ 2 \\ \end{array} } \right)\left( {\begin{array}{*{20}c} 2 \\ 2 \\ \end{array} } \right)}}{{\left( {\begin{array}{*{20}c} 5 \\ 4 \\ \end{array} } \right)}}{*}\frac{1}{{2^{2} }}{ }}} = \frac{2}{23} = \, 0.0{87}0$$
$${ }t \, = \, 5 \to \alpha = \frac{{\frac{{\left( {\begin{array}{*{20}c} 2 \\ 2 \\ \end{array} } \right)}}{{\left( {\begin{array}{*{20}c} 5 \\ 5 \\ \end{array} } \right)}}{*}\frac{1}{{2^{2} }}}}{1} = \frac{1}{4} = \, 0.{25}$$

In Algorithm 8 [17], 2k−1 × k basis matrices B0even and B1odd are created. Rows are selected randomly from B0even and B1odd according to the value of each pixel and hence k bits are generated. Then generate remaining n-k bits. Randomly rearrange and distribute these bits to generate n shares. The theoretical contrast is 0.0555, 0.2, 0.5 for t = 2,3,4 respectively in (2, 4) scheme and 0.0192, 0.0870, 0.25 for t = 3,4,5 respectively in (3, 5) scheme.

5 Experimental findings and discussions

To determine the contrast and security of the compared algorithms, experiments and analyses were conducted. The secret image can be either partially or fully reconstructed by overlapping at least k or more shares. Meaningless images are obtained when less than k numbers of shares are overlapped. The images supporting the experiments are taken from USC-SIPI image dataset. Theoretical contrast (τ), experimental contrast (α) and visual quality are compared to evaluate the contrast and similarity index of original and reconstructed images. The algorithms are implemented using Python and hence experimental contrast is calculated for the various schemes. The results of theoretical contrast of OR based (2, 4) and (3, 5) schemes by Algorithms 1–8 is depicted in Table 2. The stacked results of different combinations such as t = 2,3,4 and t = 3,4,5 are also shown in the table.

Table 2 Theoretical values of (2, 4) and (3, 5) VCS

In 2016, Yan et al. [18] studied and demonstrated the interval of values corresponding to contrast by conducting several experiments. By studying and evaluating the outputs, we found that the visual quality of the retrieved images in different algorithms varies according to the values of k and t. It is understood that the retrieved image can be identified as the original image when the calculated value of α is greater than zero. However, it is hard to recognize with the HVS when α is less than a specific value. The results of PSNR and SSIM for (3, 5) scheme for the values of t = 3,4,5 are given in Table 3.

Table 3 PSNR & SSIM values for (3, 5) VCS

Figures 2, 3, 4, 5 shows the values of theoretical contrast and experimental contrast of various (k, n) algorithms. From the depicted graphs, it can be understood that Hu et al. [16] performs better in terms of contrast and for the values of PSNR and SSIM. The secret image is given in Fig. 6. Table 4 shows the comparative analysis of visual quality, theoretical and experimental contrasts. Based on the above comparisons, the visual quality of retrieved secret images in Chen & Tsao [7] and Guo et al. [13] are less, as there are more number of black pixels in the retrieved image. Besides, Wu & Sun [11] and Hu et al. [16] schemes have enhanced visual quality.

Fig. 2
figure 2

Theoretical Contrast–(2, 4) VCS

Fig. 3
figure 3

Theoretical Contrast–(3, 5) VCS

Fig. 4
figure 4

PSNR values

Fig. 5
figure 5

SSIM values

Fig. 6
figure 6

Secret image

Table 4 Comparison of evaluation metrics of reconstructed image in related schemes

6 Conclusion and future enhancements

In this paper, we mainly focused on various schemes of (k, n) VCS based on random grids. It has been found out that Hu et al.’s algorithm surpasses other related algorithms in terms of visual quality, theoretical and experimental contrast. Some schemes used improved algorithms in order to enhance the existing contrast. General formula for calculating theoretical contrast is provided. It is also found that out of the n pixels, first k pixels are associated with the contrast and therefore the last n-k pixels can be generated by making use of the first k pixels. The relationship between visual quality and contrast deserves further investigation. The contrast of the schemes which are not given in terms of k, t and n can be considered as an open issue which is to be addressed in the future.