1 Introduction

Naor and Shamir [13] first proposed the threshold-based visual cryptography scheme (VCS) [2, 11, 1618, 21, 22, 24]. In their scheme, a binary secret image is shared by generating corresponding n noise-like shadow images. And any k or more noise-like shadow images are stacking to recover the secret image visually based on human visual system (HVS). However, less than k participants cannot reveal any information of the secret image by inspecting their shares. The main advantage of VCS by [13] is simple recovery, which means the decryption of secret image is completely based on stacking or HVS without any cryptographic computation. However, the scheme suffers from codebook (basic matrices) design and pixel expansion [18]. In order to solve the pixel expansion problem, some previous VCSs without the pixel expansion were proposed. Ito et al. [9] proposed the probabilistic VCS by equally selecting a column from corresponding basic matrix. Probabilistic VCS for different thresholds was presented by Yang [24]. Cimato et al. [2] further extended the generalization probabilistic VCS.

Visual secret sharing (VSS) by random grids (RG) [3, 4, 25] has gained much attention since it can avoid the pixel expansion problem as well as requires no codebook design. Encryption of binary secret images based on RG was first presented by Kafri and Keren [8], each of which is generated into two noise-like RGs (also called shadow images or share images) that have the same size as the original secret image. The decryption operation is the same as traditional VCS. However, the relative RG-based VSS schemes [6, 8, 10, 15, 20, 23] are only for cases (2, 2), (2, n) or (nn).

For the case (kn), Chen and Tsao [1] proposed a RG-based (kn) threshold VSS by applying (2, 2) RG-based VSS repeatedly for the first k bits and generating the last \(n-k\) bits randomly.

Then, Wu and Sun [19] improved the visual quality of recovered secret image in [1] through changing the last \(n-k\) bits from randomly selecting to be equal to the k th bit. Recently, Guo et al. [5] improved the visual quality of Chen and Tsao’s scheme [1] in another approach. They applied Chen and Tsao’s scheme [1] for every k bits and \(N_k = \left\lfloor {n / k} \right\rfloor\) times, and set the last \(n - N_k \times k\) bits randomly. However, the visual quality of the revealed secret image is still poor in their schemes [5, 19].

In this paper, a new RG-based (kn) threshold VSS scheme is proposed, which has better visual quality than both Wu and Sun’s scheme [19] and Guo et al.’s scheme [5]. In our design, based on analyzing the factors that affect the visual quality, we better utilize the random bits in the n bits to remedy the contrast and the visual quality. The result obtained by the proposed scheme is much better than those obtained by [19] and [5]. In addition, the property of getting higher contrast makes our method also suitable for more complex images, such as gray level and color images.

The rest of the paper is organized as follows. Section 2 introduces some basic requirements and related works for the proposed scheme. In Sect. 3, the proposed scheme is presented in detail. Section 4 gives the performance analyses of the proposed scheme. Section 5 is devoted to experimental results. Finally, Sect. 6 concludes this paper.

2 Preliminaries

In this section, we give some preliminaries and related works, i.e., RG-based [1, 5, 19] VSS, as the basis for the proposed scheme. In what follows, symbols \(\oplus\) and \(\otimes\) denote the Boolean XOR and OR operations. b is a bit-wise complementary operation of a bit b. The binary secret image S is shared among n shadow images, while the recovered secret image \(S'\) is recovered from \(t ( 2 \le t \le n,t \in Z^ +)\) shadow images by stacking.

For a certain pixel x in binary image X with size of \(M\times N\), the probability of pixel color is transparent or white (0), say \(P(x = 0)\), and the same for pixel color is opaque or black (1). Besides, \(P(S = 0) = 1 - \frac{1}{MN}\sum \nolimits _{i = 1}^M {\sum \nolimits _{j = 1}^N {S(i,j)} },1 \le i \le M,1 \le j \le N\).

AS0 (resp., AS1) denotes the white (resp., black) area of original secret image S defined as \(AS0 = \{(i,j)\vert S(i,j) = 0,1 \le i \le M,1 \le j \le N\}\) (resp., \(AS1 = \{(i,j)\vert S(i,j) = 1,1 \le i \le M,1 \le j \le N\}\)).

Definition 1

(Contrast) The visual quality, which will decide how well human eyes could recognize the recovered image, of the recovered secret image \({S}'\) corresponding to the original secret image S is evaluated by contrast defined as follows [1, 14]:

$$\begin{aligned} \alpha =\frac{P_0 - P_1 }{1 + P_1 } = \frac{P({S}'\left[ {AS0} \right] = 0) - P({S}'\left[ {AS1} \right] = 0)}{1 + P({S}'\left[ {AS1} \right] = 0)} \end{aligned}$$
(1)

where \(\alpha\) denotes contrast, \(P_0\) (resp., \(P_1\)) is the appearance probability of white pixels in the recovered image \({S}'\) in the corresponding white (resp., black) area of original secret image S, that is, \(P_0\) is the correctly decrypted probability corresponding to the white area of original secret image S, and \(P_1\) is the wrongly decrypted probability corresponding to the black area of original secret image S.

Definition 2

(Visually recognizable) [1, 13] The recovered secret image \({S}'\) could be recognized as the corresponding original secret image S if \(\alpha > 0\) when \(t \ge k\).

Definition 3

(Security) [1, 13] The scheme is secure if \(\alpha = 0\) when \(t < k\), which means no information of S could be recognized through \({S}'\)

Generally speaking, a valid VC construction should satisfy two conditions:

  1. 1.

    Security condition corresponding to Definition 3: security condition means that insufficient shares give no clue about secret, i.e., \({{P}_{0}}={{P}_{1}}\).

  2. 2.

    Contrast condition corresponding to Definition 2: contrast condition indicates that sufficient shares reveal the secret, i.e., \(\alpha >0\).

Remark Both contrast and evenness can measure the visual quality of the recovered secret image. The evenness is generally represented with the variance of the darkness levels of a block. Contrast is more significant than evenness to evaluate visual quality. Evenness [12] can be the supplementary evaluation measurement for the visual quality when the contrast is nearly the same. Since the contrast of the proposed scheme is different from that of the related methods, which will be shown in Sect. 5, the visual quality of revealed secret image is evaluated by contrast in this paper. The contrast is expected to be as large as possible to obtain better visual quality.

In RG-based VSS [1], shadow images covered secret after sharing are denoted as \(S{{C}_{p}}\). The recovered secret image is denoted as \({S}'\). Here 0 denotes white pixel, 1 denotes black pixel. The generation and recovery phases of original (2, 2) RG-based VSS are described below.

  1. Step 1:

    Randomly generate 1 RG \(SC_1\).

  2. Step 2:

    Compute \(SC_2\) as in Eq. (2).

Recovery \({S}' = SC_1 \otimes SC_2\) as in Eq. (3). If a certain secret pixel \(s = S(i,j)\) of S is 1, the recovery result \(SC_1 \otimes SC_2 = 1\) is always black. If a certain secret pixel is 0, the recovery result \(SC_1 \otimes SC_2 = SC_1 (i,j) \otimes SC_1 (i,j)\) has half chance to be black or white since \(SC_1\) is generated randomly.

$$\begin{aligned} SC_2 (i,j) = \left\{ \begin{array}{l} SC_1 (i,j)\quad \mathrm{if}\;S = 0\; \\ \overline{SC_1 (i,j)} \quad \mathrm{if}\;S = 1 \\ \end{array} \right. \end{aligned}$$
(2)
$$\begin{aligned} S'(i,j) = SC_1 (i,j) \otimes SC_2 (i,j) = \left\{ \begin{array}{ll} SC_1 (i,j) \otimes SC_1 (i,j) & {\rm if}\;S(i,j) = 0\; \\ SC_1 (i,j) \otimes \overline{SC_1 (i,j)} \; = 1 & {\rm if}\;S(i,j) = 1 \\ \end{array} \right. \end{aligned}$$
(3)

In fact, Eq. (2) is equal to \(sc_2 = sc_1 \oplus s\) or \(s = sc_1 \oplus sc_2\). Since if \(s = 0 \Rightarrow sc_2 = sc_1 \oplus 0 \Rightarrow sc_2 = sc_1\), and if \(s = 1 \Rightarrow sc_2 = sc_1 \oplus 1 \Rightarrow sc_2 = \overline{sc_1 }\). The same equation could be extended to \(s = sc_1 \oplus sc_2 \oplus \cdots \oplus sc_k\) and the same approach can be extended to (kn) threshold scheme by applying the above process repeatedly for the first k bits and generating the last \(n-k\) bits randomly. (kn) RG-based VSS is described as follows:

figure a

In addition, Wu and Sun’s scheme [19] improves the contrast of the scheme [1] by change the last \(n-k\) bits to be equal to kth bit in step 5 of Chen and Tsao’s (kn) RG-based VSS.

Guo et al. [5] improve the visual quality of Chen and Tsao’s scheme [1] in another approach, that is computing every k bits by applying Chen and Tsao’s scheme for \(N_k = \left\lfloor {n / k} \right\rfloor\) times, and setting the last \(n - N_k \times k\) bits randomly. The details of the schemes may refer to [5, 19].

Based on the above three RG-based VSS schemes, there are random bits in the corresponding n bits. The random bits are utilized in Wu and Sun’s scheme and Guo et al.’s scheme to improve the visual quality in different methods. In this paper, the random bits are better utilized to gain enhanced visual quality. The differences between the proposed scheme and other schemes will be compared and analyzed in Sect. 5.3.

3 The proposed scheme

Here, we propose a novel (kn) (generally \(n,k \in \mathrm{Z}^ +,2 \le k \le n\)) VSS based on RG.

3.1 Scheme: visual quality-enhanced threshold VSS based on random girds

Prior to give the detail of the proposed scheme, the diagrammatic design concepts comparison between the proposed scheme and related schemes is shown in Fig. 1. There are some random bits, such as the middle \((N_k - 1)\times k\) bits and the last \(n-k\) bits in the previous schemes [1, 5, 19], which are applied for improving the visual quality in the proposed scheme.

Fig. 1
figure 1

The design concepts comparison between the proposed scheme and related schemes

Fig. 2
figure 2

Shadow images generation architecture of the proposed scheme

The shadow images generation architecture of the proposed scheme is illustrated in Fig. 2, the algorithmic steps are described in Algorithm 2.

figure b

The secret recovery of the proposed scheme is also based on stacking \(( \otimes )\) or HVS.

The idea of Algorithm 2 is described precisely as follows:

There are random bits in the n bits. The random bits could be utilized to gain better properties, such as threshold mechanism, and improving the visual quality. In step 2 of Algorithm 2, the k bits are utilized to gain threshold mechanism [1], i.e., when less than k shadow images are collected, the secret cannot be revealed, which are the same as Chen and Tsao’s scheme, Wu and Sun’s scheme, and Guo et al.’s scheme. While step 3 of Algorithm 2 aims to improve the visual quality of recovered secret image by a different way to utilize the last \(n-k\) bits, through which the probability of covering \(b_1,b_2, \ldots b_k\) in the recovered t bits is improved. In step 4 of Algorithm 2, aiming to make all the shadow images be equal to each other, the generated n bits are randomly rearranged to corresponding n shadow images bits.

3.2 Extension to grayscale/color images

The proposed scheme can be extended to share grayscale/color images [1, 7, 19]. To share a grayscale image, halftone technologies such as error diffusion [17] are applied to convert the grayscale image into binary image, then the proposed scheme could be used.

For sharing a color image, color decomposition, halftone technologies and color composition are applied. A color image can be described by color model. Here, CMY (cyan–magenta–yellow) model will be applied, which is subtractive color model, and displays a color by reflecting light from a surface of an object. Based on the color model, a color image can be processed by three grayscale images (R, G, B) with the same extension methods for sharing grayscale images.

4 Performance analyses

This section gives the performances of the proposed scheme by theoretically analyzing the security and the visual quality. By Theorem 1, we prove that proposed scheme is a valid \(\left( {k,n} \right)\) threshold VSS construction when stacking decryption is applied. Before the proof of Theorem 1, two Lemmas are proved.

The essences of the security and performance (visually recognizable) are analyzed as follows:

  1. 1.

    Every single shadow image is secure: which means there is no cross interference of the secret image in every shadow image, i.e. every single shadow image could reveal nothing of the secret image. Aiming to realize this, every bit \(sc_i\) in \(sc_1,sc_2, \ldots sc_n\) should be random, no relationship with or not decided by corresponding secret bit s.

  2. 2.

    Collusion attack security: which means nothing of the secret image can be revealed with less than k shadow images. Aiming to realize this, any t bits \(SC_{j_1}, SC_{j_2 }, \ldots SC_{j_t }, t \le k - 1\) in \(sc_1,sc_2, \ldots sc_n\) cannot decide the corresponding secret bit s.

  3. 3.

    Visually recognizable: which means part of the secret image will be revealed with k or more shadow images. Aiming to realize this, any t bits \(SC_{j_1 },SC_{j_2 }, \ldots SC_{j_t },t \ge k\) in \(sc_1 ,sc_2, \ldots sc_n\) can decide the corresponding secret bit s in a certain probability.

The random rearrangement in the related schemes will lead to different combinations for the t bits in the corresponding t collected shadow images. In addition, the contrast in Definition 1 is based on statistics, hence there is a certain probability. In the following Sections, we will know that the “certain probability” is the probability of picking up \(b_1,b_2, \ldots b_k\) bits from the t bits.

The related RG-based VSS [1, 5, 19] utilizes the random bits to improve the “certain probability” (the visual quality), under the secure condition, where “certain probability” is the probability that can correctly reconstruct the secret pixels, i.e., the probability of introducing the contrast.

Lemma 1

Assume \(sc_1,sc_2, \ldots ,sc_k\) are generated by the proposed scheme, we have \(s = sc_1 \oplus sc_2 \oplus \ldots \oplus sc_k\).

Proof

Taking the first k bits, as an example, for the proof.

Intuitively, Eq. (2) is equal to Eq. (4).

$$\begin{aligned} sc_2 = sc_1 \oplus s \quad \mathrm{or} \quad s = sc_1 \oplus sc_2 \end{aligned}$$
(4)

Since if \(s = 0 \Rightarrow sc_2 = sc_1 \oplus 0 \Rightarrow sc_2 = sc_1\), and if \(s = 1 \Rightarrow sc_2 = sc_1 \oplus 1 \Rightarrow sc_2 = \overline{sc_1 }\). And the equations will be used in the proposed scheme. The same approach could be extended to

$$\begin{aligned} s = sc_1 \oplus sc_2 \oplus \cdots \oplus sc_k \end{aligned}$$
(5)

In the recovery phase, in a similar way, the recovered secret bit by stacking any \(t(k \le t \le n)\) bits of shadow images satisfies to:

$$\begin{aligned} s = sc_1 \otimes sc_2 \otimes \cdots \otimes sc_t \end{aligned}$$
(6)

Recall that “0” denotes white pixels, “1” denotes black pixels. The first k bits before the rearrangement have the relationship in Eq. (5) of the generation phase, stacking t bits have the relationship in Eq. (6) of the recovery phase.

Without loss of generality, in the following proof, we assume \(sc_1 ,sc_2, \ldots ,sc_n\) are corresponding to \(b_1,b_2, \ldots ,b_n.\)

Lemma 2

In the proposed scheme,

\(if \, s=0, \quad P(SC_{1 \otimes 2 \otimes \cdots k - 1 \otimes k} \left[ {AS0} \right] = 0) = P(SC_{1 \otimes 2 \otimes \cdots k - 1} \left[ {AS0} \right] = 0) = (1 / 2)^{k - 1}\).

\(if \, s = 1, \quad P(SC_{1 \otimes 2 \otimes \cdots k - 1 \otimes k} \left[ {AS1} \right] = 0) = 0\).

Where \(SC_{1 \otimes 2 \otimes \cdots k - 1 \otimes k}\) denotes \(SC_1 \otimes SC_2 \cdots \otimes SC_k\).

Proof

Generally, the bits \(sc_1,sc_2, \ldots sc_{k - 1}\) are random and independent with each other and s. \(sc_k\) is related with and dependent on \(sc_1 \oplus sc_2 \oplus \cdots sc_{k - 1}\) and s according to Eq. (5) of Lemma 1.

Hence,

$$\begin{aligned} &P(SC_{1 \otimes 2 \otimes \cdots k - 1} \left[ {AS0} \right] = 0) = (1 / 2)^{k - 1}, \\ &P(SC_{1 \otimes 2 \otimes \cdots k - 1} \left[ {AS1} \right] = 0) = (1 / 2)^{k - 1} \end{aligned}$$
(7)

If \(s = 0\), based on Eq. (5) and Eq. (6), we will prove:

$$\begin{aligned} P(SC_{1 \otimes 2 \otimes \cdots k - 1 \otimes k} \left[ {AS0} \right] = 0) = P(SC_{1 \otimes 2 \otimes \cdots k - 1} \left[ {AS0} \right] = 0) = (1 / 2)^{k - 1} \end{aligned}$$
(8)

If \(sc_k = 0\), then \(P(SC_{1 \otimes 2 \otimes \cdots k - 1 \otimes k} \left[ {AS0} \right] = 0) = P(SC_{1 \otimes 2 \otimes \cdots k - 1} \left[ {AS0} \right] = 0)\) sets up.

If \(sc_k = 1\), then \(sc_k\) is equal to one of \(sc_1,sc_2, \ldots sc_{k - 1}\). If not, every one of \(sc_1,sc_2, \ldots sc_{k - 1}\) is complementary to \(sc_k\) \(\Rightarrow\)

\(sc_1 = sc_2 = \cdots sc_{k - 1} = 0 \Rightarrow s = 0 \oplus 0 \cdots \oplus 0 \oplus 1 = 1\) with contradiction to \(s = 0\).

Hence \(sc_k\) is equal to one of \(sc_1,sc_2, \ldots sc_{k - 1}\), then \(P(SC_{1 \otimes 2 \otimes \cdots k - 1 \otimes k} \left[ {AS0} \right] = 0) = P(SC_{1 \otimes 2 \otimes \cdots k - 1} \left[ {AS0} \right] = 0)\) also sets up.

Thus, if \(s = 0\) \(\Rightarrow\) \(P(SC_{1 \otimes 2 \otimes \cdots k - 1 \otimes k} \left[ {AS0} \right] = 0) = P(SC_{1 \otimes 2 \otimes \cdots k - 1} \left[ {AS0} \right] = 0)\) \(\Rightarrow\) Eq. (8) sets up.

In a similar way, if \(s = 1\) we have

$$\begin{aligned} P \left (SC_{1 \otimes 2 \otimes \cdots k - 1 \otimes k} \left[ {AS1} \right] = 0 \right ) = 0 \end{aligned}$$
(9)

In order to improve the contrast, based on Lemma 2, the probability of collecting \(b_1,b_2, \ldots b_k\) should be as large as possible. Hence, step 3 of the proposed scheme is designed to improve the probability.

Theorem 1

The proposed scheme is secure and visually recognizable, it is a valid (kn) RG-based VSS.

Proof

First, every single shadow image that according the proposed scheme is secure. There is no cross interference of the secret image in every shadow image, i.e. every single shadow image could reveal nothing of the secret image. Every bit \(sc_i\) in \(sc_1,sc_2, \ldots sc_n\) should be random, no relationship with or not decided by corresponding secret bit s.

Second, according to Lemma 2,

\(P(SC_{1 \otimes 2 \otimes \cdots k - 1} [ {AS0} ] = 0) = (1 / 2)^{k - 1},P(SC_{1 \otimes 2 \otimes \cdots k - 1} [ {AS1} ] = 0) = (1 / 2)^{k - 1}.\) Hence, \(P_0 = P_1\) when \(t < k\). As a result, the security condition is satisfied.

Moreover, based on Eqs. (8) and (9), \(P_0 > P_1\) when \(t \ge k\). Thus, the proposed scheme satisfy the contrast condition.

Based on the above discussions, Definitions 2 and 3, the conclusion follows immediately. The proposed scheme is a valid (kn) RG-based VSS.

We note that, the theoretical contrast of the proposed scheme is not given directly by kt and n , which is left as an open problem for further studies [5].

5 Experimental results and analyses

In this section, we conduct experiments and analyses to evaluate the effectiveness of the proposed scheme. In the experiments, several secret images are used: original binary secret image1 as shown in Fig. 3a, and original binary secret image2 as shown in Fig. 4a are used as the binary secret images, with size of 512 \(\times\) 512, to test the efficiency of the proposed scheme.

Fig. 3
figure 3

Experimental example of the proposed (3, 4) scheme. a Secret image1. b Shadow image \(SC_1\). c Shadow image \(SC_2\). d Shadow image \(SC_3\). e Shadow image \(SC_4\). f Recovered image \(SC _{1} \otimes SC_{2} \otimes SC_{3}\). g Recovered image \(SC _{1} \otimes SC _{2} \otimes SC_{4}\). h Recovered image \(SC _{1} \otimes SC _{3} \otimes SC_{4}\). i Recovered image \(SC _{2} \otimes SC _{3} \otimes SC _{4}\). j Recovered image \(t =4\). k Recovered image \(SC _{1} \otimes SC_{2}\). l Recovered image \(SC _{1} \otimes SC _{3}\). m Recovered image \(SC _{1} \otimes SC_{4}\). n Recovered image \(SC _{2} \otimes SC_{3}\). o Recovered image \(SC _{2} \otimes SC_{4}\). p Recovered image \(SC _{3} \otimes SC_{4}\)

Fig. 4
figure 4

Experimental example of the proposed (2, 5) scheme. a Secret image2. b Shadow image \(SC_1\). c Recovered image \(SC _{1} \otimes SC _{2}\). d Recovered image \(SC _{1} \otimes SC _{2} \otimes SC _{3}\). e Recovered image \(SC _{1} \otimes SC_{2} \otimes SC _{3} \otimes SC _{4}\). f Recovered image \(SC _{1} \otimes SC _{2} \otimes SC_{3} \otimes SC_{4} \otimes SC_{5}\)

5.1 Image illustration

In our experiments, (3, 4) (i.e. \(k =\) 3\(, n =\) 4) threshold of scheme with secret image1, (2,  5) threshold of scheme with secret image2 are used to do the test of the proposed scheme.

Figure 3b–e show the 4 shadow images \(SC_{1}\), \(SC_{2}\) ,\(SC_{3 }\) and \(SC_{4}\), which are noise like. Figure 3f–j show the recovered secret image with any 3 or 4 shadow images with stacking recovery, from which the secret image recovered from \(t=k=\) 3 shadow images could be recognized based on stacking. Figure 3k–p show the recovered secret image with any less than k shadow images based on stacking recovery, from which there is no information could be recognized.

The next example, we only give the results by the first t th shadow images for saving pages.

Figure 4b shows one of the 5 shadow images, which is noise like. Figure 4c–f show the recovered binary secret image with any \(t\left( {2 \le t \le 5} \right)\) (taking the first t shadow images as an example) with stacking recovery, from which better visual of the recovered secret will be gained by stacking more shadow images.

Based on the obtained results we can conclude that:

  • The shadow images are noise like, hence the proposed scheme has no cross interference of secret image in single shadow image.

  • The progressive visual quality of the recovered secret can be gained for the proposed.

  • When \(t < k\) shadow images are collected, there is no information of the secret image could be recognized, which shows the security of the proposed scheme.

  • When \(t(k \le t \le n)\) shadow images are recovered by stacking, the secret image could be recognized by HVS.

5.2 Visual quality of the recovered secret images

The visual quality of the recovered secret images is evaluated by contrast in Definition 1. The same original binary secret image as shown in Fig. 3a is used to do the experiments of contrast.

Table 1 Average contrast of the proposed scheme

Average contrast of the proposed (kn) (\(2 \le k \le n\)) scheme is shown in Table 1. Where t is the number of recovered shadow images.

From Table 1, we can find that, in the proposed scheme, \(\alpha > 0\) when \(t \ge k\) and contrast increases as t increases for a certain (kn) with stacking recovery when \(2 \le n \le 5\) . The experimental results of the contrast verify the validity of the performance analysis on the contrast.

5.3 Comparisons with related schemes

Herein, we compare the proposed scheme with other related schemes especially Chen and Tsao’s scheme [1], Wu and Sun’s scheme [19], and Guo et al. ’s scheme [5], since both the proposed scheme and [19] and [5] are a continuous and extension work of the schemes [1]. In addition, schemes in [1, 19] and [5] have good features in VSS, such as no codebook design, no pixel expansion and so on.

Fig. 5
figure 5

Comparison of (2, 4) threshold between the related schemes

5.3.1 Image illustration comparison

In this section, (2, 4) threshold with \(k \le t \le n\) is applied as an example shown in Fig. 5. We can see that Wu and Sun’s scheme [19] and Guo et al.’s scheme [5] both improve the visual quality of Chen and Tsao’s scheme. The proposed scheme has the best visual quality in comparison with the three schemes. Guo et al.’s scheme and Chen and Tsao’s scheme are darker, while the darkness of the proposed scheme is acceptable, since \(sc_1 \otimes sc_2 \otimes \cdots \otimes sc_k \cdots \otimes sc_{n - 1} \otimes sc_n = sc_1 \otimes sc_2 \otimes \cdots \otimes sc_k\) in the proposed scheme.

Table 2 Contrast of Chen and Tsao’s scheme and Wu and Sun’s scheme
Table 3 Contrast of Guo et al.’s scheme and ours

5.3.2 Contrast comparison

Tables 2 and 3 show contrast comparisons of recovered secret images between the proposed scheme with all \(( k, n )( 2 \le n \le 5,2 \le k \le n,k \le t \le n )\) and Chen and Tsao’s scheme [1], Wu and Sun’s scheme [19], and Guo et al. ’s scheme [5]. The results indicate the visual quality of proposed scheme is similar as or overall greater than others.

  1. 1.

    If \(t=n\) for case (nn), the contrast of the proposed scheme is nearly the same as that of the others, since they reduce to the same algorithm.

  2. 2.

    For case \((n-1,n)\), the contrast of the proposed scheme is similar as that of Wu and Sun’s scheme [19], since

    $$\begin{array}{l} sc_1 \otimes sc_2 \otimes \cdots \otimes sc_{k - 1} \otimes sc_k \otimes sc_n \\ = sc_1 \otimes sc_2 \otimes \cdots \otimes sc_{k - 1} \otimes sc_k \otimes sc_k \\ = sc_1 \otimes sc_2 \otimes \cdots \otimes sc_{k - 1} \otimes sc_k \\ \end{array}$$

    in Wu and Sun’s scheme [19], and in the proposed scheme, we have

    $$\begin{array}{l} sc_1 \otimes sc_2 \otimes \cdots \otimes sc_{k - 1} \otimes sc_k \otimes sc_n \\ = sc_1 \otimes sc_2 \otimes \cdots \otimes sc_{k - 1} \otimes sc_k \otimes sc_1 \\ = sc_1 \otimes sc_2 \otimes \cdots \otimes sc_{k - 1} \otimes sc_k \\ \end{array}.$$
  3. 3.

    The proposed scheme is overall greater than others for the other (kn) cases when \(n - k \ge 2\). Especially for cases (2, 4) and (2, 5), the contrast of the proposed scheme achieves 0.5, since the probability of correctly reconstructing the secret pixels of the proposed scheme is larger than that of the others.

  4. 4.

    The contrast of stacking \(t=n-1\) is the same as that of stacking \(t=n\) for cases (2, 4) and (2, 5), since \(sc_1 \otimes sc_2 \otimes \cdots \otimes sc_k \cdots \otimes sc_{n - 1}\otimes sc_n = sc_1 \otimes sc_2 \otimes \cdots \otimes sc_k\) in the proposed scheme.

Remark The theoretical contrast of the proposed scheme is not given directly by kt and n, hence the contrast comparisons are given by experiments. In addition, Definition 1 is a statistical result. Thus, the experimental results are close to the theoretical contrast.

The related RG-based VSS [1, 5, 19] is utilizing the random bits to improve the certain probability (the visual quality), under the secure condition. In the proposed scheme, the probability of introducing the contrast is improved as large as possible through step 3 of the proposed scheme.

5.3.3 Further analyses and discussions

The difference between related Algorithms and the proposed scheme lies in step 3 of the proposed scheme. Herein, we discuss why visual quality of the proposed scheme is better than others.

The secret information, i.e., S(ij), is covered by \(b_1,b_2, \ldots b_k\) according to the related Algorithms. Hence, the visual quality of the revealed secret image depends on the probability of picking up \(b_1,b_2, \ldots b_k\) bits from the t bits, i.e., a larger probability of collecting \(b_1,b_2, \ldots b_k\) will lead to better visual quality of the reconstructed secret image, where t is the number of stacking shares. Thus, detail discussions about the related Algorithms are examined as follows.

  1. 1.

    In Chen and Tsao’s scheme, if the user wants to collect \(b_1,b_2, \ldots b_k\), the user has to pick up exactly \(b_1,b_2, \ldots b_{k - 1}\) and \(b_k\). So the probability is low.

  2. 2.

    The user can collect \(b_1 ,b_2, \ldots b_k\) and any one of \(b_k,b_{k + 1}, \ldots b_n\) for obtaining \(b_1,b_2, \ldots b_k\) in Wu and Sun’s scheme. Thus, the probability is improved.

  3. 3.

    The user can reveal S(ij) through collecting any one of \(Q_1,Q_2, \ldots Q_{\left\lfloor {\frac{n}{k}} \right\rfloor }\) in Guo et al.’s scheme, where \(Q_i (1 \le i \le \left\lfloor {\frac{n}{k}} \right\rfloor )\) represents the k pixels generated by the i-th loop in Guo et al.’s scheme. Hence, the better visual quality is introduced than Chen and Tsao’s scheme. Meanwhile, \(Q_i\) will affect \(Q_j\), and the last \(n - k\left\lfloor {\frac{n}{k}} \right\rfloor\) bits generated by step 4 don’t cover any secret information, which will restrain the visual quality, where \(1 \le i,j \le \left\lfloor {\frac{n}{k}} \right\rfloor ,i \ne j\).

  4. 4.

    Based on step 3 of the proposed scheme, we can obtain any one of \(b_1,b_{k + 1},b_{2k + 1}, \ldots ,b_{\left\lfloor {\frac{n}{k}} \right\rfloor k + 1}\), any one of \(b_2,b_{k + 2},b_{2k + 2},\ldots ,b_{\left\lfloor {\frac{n}{k}} \right\rfloor k + 2}, \ldots,\) and any one of \(b_k,b_{2k} ,b_{3k}, \ldots ,b_{\left\lfloor {\frac{n}{k}} \right\rfloor k}\) to gain \(b_1,b_2, \ldots b_k\). As a result, the probability is significantly enhanced which will lead to better visual quality.

According to above analyses, the following conclusions are presented.

  1. 1.

    When \(k = n\), the related Algorithms are the same.

  2. 2.

    The proposed scheme has the same visual quality as Wu and Sun’s scheme if \(n = k + 1\) or \(n = t\).

  3. 3.

    The best visual quality is achieved in the proposed scheme when \(n - k \ge 2 \wedge t \ne n\).

Fig. 6
figure 6

Reconstructed secret image comparison between the related schemes for case (3, 8)

Fig. 7
figure 7

Contrast curves of the related schemes for case (3, 8)

The above three points are validated in Tables 2 and 3, where few non-conformities are due to randomness. Furthermore, Fig. 6 indicates additional visual quality comparison between the related Algorithms for case (3, 8), where \(n - k = 6 > 2\) and corresponding contrast curves are exhibited in Fig. 7. By all appearances, the proposed scheme outperforms the other three methods.

6 Conclusion

This paper proposed a new RG-based VSS with improved visual quality by specially utilizing the random bits, which outperformed relative schemes, i.e. Chen and Tsao’s scheme, Wu and Sun’s scheme and Guo et al.’s scheme. The probability of reconstructing the secret pixels is improved as large as possible. The crucial successful points in the proposed scheme lie in: (1) (kn) threshold, (2) requiring no codebook design, (3) avoiding the pixel expansion problem, (4) larger visual quality than the previous related schemes. However, the contrast of the proposed scheme is not given directly by kt and n, which is left as an open problem for further studies.