Block-Based Steganography Method Using Optimal Selection to Reach High E ﬃ ciency and Capacity for Palette Images

: The primary goal of steganographic methods is to develop statically undetectable methods with high steganographic capacity. The embedding e ﬃ ciency is one kind of measure for undetectability. Block-based steganography methods have been proposed for achieving higher embedding e ﬃ ciency under limited embedding capacity. However, in these methods, some blocks with larger embedding distortions are skipped, and a location map is usually incorporated into these methods to record the embedding status of each block. This reduces the embedding capacity for secret messages. In this study, we proposed a block-based steganography method without a location map for palette images. In this method, multiple secret bits can be embedded in a block by modifying at most one pixel with minimal embedding distortion; this enables each block to be used for data embedding; thus, our method provides higher embedding capacity. Furthermore, under the same capacity, the estimated and experimental embedding e ﬃ ciencies of the proposed method are compared with those of Imaizumi et al. and Aryal et al.’s methods; the comparisons indicate that the proposed method has higher embedding e ﬃ ciency than Imaizumi et al. and Aryal et al.’s methods.

A palette image includes a palette and an index table. The palette consists of a few (generally no more than 256) colors. Each pixel is represented by a color in the palette, and the index table records each pixel's corresponding color index. In general, the order of colors in the palette is random. Because only limited colors are used in palette images, modifying a pixel's color index considerably distorts the pixel color. Thus, embedding data into a palette image is more challenging than in other image formats.
The remainder of this paper is organized as follows. Related works are introduced in Section 2. The proposed method is presented in Section 3. The analysis of embedding capacities is given in Section 4. Experimental results are provided in Section 5. Finally, conclusions are presented in Section 6.

Related Works
In this section, the parity assignment method proposed by Tanaka et al. [14] and referenced in the proposed method is first described. Then, the method proposed by Aryal et al. [17] is described; it is used to make a comparison with the proposed method.

Parity Assignment Method Proposed by Tanaka et al.
Tanaka et al. proposed an algorithm to assign k parity bits to each color in the palette of an image. The algorithm contains two parts. In the first part, from the palette, 2 k closest colors (c 0 , . . . , c 2 k −1 ) are determined sequentially, c i is assigned a k-bit parity with value i. Next, 2 k sets (S 0 , . . . , S 2 k −1 ) are established, that is, S i = c i . In the second part, from the unassigned colors, the color c with the minimal distance from the last assigned color is determined. Next, the minimal distance d p of c from each set S p is evaluated. Then, the maximal distance d p among { d p p = 0, . . . , 2 k − 1 } is determined and p is assigned as the parity of color c. The procedure is repeated until all colors are assigned.
In the algorithm, the distance d c i ,c j between two colors c i = (r i , g i , b i ) and c j = r j , g j , b j is defined using the following expression: The details of the parity assignment are described as follows: Step 1: Let A be the set of all colors in the palette. Let S q = φ, and assign parity q to S q ; q = 0, . . . , 2 k − 1.
Step 2: Let h = 0. Find an initial color c ' h using the following expression: Step 3: Let h = h + 1. Find color c ' h in A with the minimum distance from c ' h−1 using the following equation: Step 4: Repeat Step 3 until h = 2 k − 1.
Step 5: Let h = h + 1. Find color c h in A with the minimum distance from c h−1 using Equation (3).
Step 6: In each S q , q = 0, . . . , 2 k − 1, find the color in S q with the minimum distance md q from c h using the following expression: Step 7: Find the maximum distance md q among all md q using the following expression: Appl. Sci. 2020, 10, 7820 4 of 16 Step 8: Repeat Steps 5 to 7 until A is empty.

Aryal et al.'s Method
Aryal et al.'s method [17] improves the capacity and image quality of Imaizumi et al.'s method [16]. In the method, the color c of each pixel in the RGB color space is first converted to color (L*, a*, b*) in the L*a*b color space, and the CIEDE2000 formula [25] is used to calculate the color distance. The method includes three processes: Palette reordering, block embedding, and extraction. In the method, the k-bit messages are embedded into each 2 k−2 + 1 pixel matrix. For convenience, we assumed k = 3 in the following processes.
Step 2: Set h = 0. Find the first color c ' h in P using the following expression: where L * i is the luminance component of color c i in the L*a*b color space.
where ∆E c ' h−1 ,c i is the CIEDE2000 color distance [25] between c ' h−1 and c i . Step 4: Repeat Step 3 until h = 255.

Embedding Process
Step 1: Divide the cover image into nonoverlapping blocks, each of which contains 1 × 3 pixels.
Step 2: Reorder palette P to obtain a new palette P using the palette reordering process.
Step 3: Consider a block B with three pixels (B 0 , B 1 , B 2 ) and three secret data bits w.
Step 4: Let I i be the color index of B i in P , i = 0, 1, 2.
Step 5: Calculate T 0 and T 1 using the following equations.
Step 6: Obtain t 0 and t 1 based on Table 1 and secret data w.
Step 7: If T 0 = t 0 and T 1 = t 1 , then go to Step 10.
Case 2: If T 1 − t 1 = 1 or T 1 − t 1 = −3, then either I 1 or I 2 is changed by −1; this depends on whether ∆E c ' is smaller. Step 10: Go to Step 3 until all secret data are embedded.
If any ∆E > 5 in the embedding process, the current block is skipped, and no secret data are embedded. An additional location map is required for recording if a block is used to embed secret data.

Extraction Process
Step 1: Divide the stego image into nonoverlapping blocks, each of which contains 1 × 3 pixels.
Step 2: Reorder palette P to obtain a new palette P through the palette reordering process used in the embedding process.
Step 3: According to the location map, consider an embedded block B with three pixels (B 0 , B 1 , B 2 ).
Let I i be the color index of B i in P , i = 0, 1, 2.
Step 4: Calculate t 0 and t 1 using the following equations: Step 5: Extract w according to Table 1, t 0 and t 1 .
Step 6: Go to Step 3 until all embedded blocks are processed.
In Imaizumi et al. and Aryal et al.'s methods, for data extraction, the receiver requires the positions of embedded blocks. Thus, a location map with one bit for each block should be transmitted to the receiver; this will reduce the embedding capacity for secret data, and will be discussed in Section 4. To overcome this disadvantage, a novel BBM was proposed; it does not require a location map.

Proposed Method
To avoid using a location map and to obtain higher embedding efficiency and capacity, a novel BBM for palette images is proposed. The method includes three processes: Parity assignment, embedding, and extraction. In the parity assignment process, Tanaka et al.'s assignment [14] is used to assign a k-bit parity to each color in a palette. Through the assignment, a stego image with lower embedding distortion can be obtained, such that a location map is not required for secret data extraction. In the embedding process, an optimal scheme is provided to select the pixel in a block with the minimal embedding distortion; this makes each block used for data embedding. The embedding process is performed as follows:

Embedding Process
Step 1: Divide the cover image into nonoverlapping blocks, each of which contains n × m pixels.
Step 2: Use Tanaka et al.'s parity assignment to assign a k-bit parity to each color in palette P.
Step 3: Take one block B with pixels (B 0 , . . . , B n×m−1 ) and k secret data bits w sequentially.
Step 4: Let c B j be the color of B j , and q j be the parity of c B j , 0 ≤ j ≤ n × m − 1.
Step 5: Calculate r using the following expression: Step 6: If r = w, then go to Step 10.
Step 7: For each pixel B j , parity q ' j is calculated using the following equation: Step 8: For each pixel B j , find a new color c * B j with parity q ' j according to the following equation: where S q ' j is the set of all colors with parity q ' j .
Step 9: Consider pixel B α satisfying the following expression, and set the color of B α to be c * Step 10: Repeat Steps 3 to 9 until all blocks are processed. In Step 2, Tanaka et al.'s parity assignment is used; it makes each color be able to find a closer color in each set with a different parity. In Step 8, for each pixel, we always select the color with the required parity and the minimal embedding distortion to replace the original color. In Step 9, at most one pixel is modified with the minimal embedding distortion. Through these three steps, each block is used to embed secret data, and the embedding quality is also improved.

Extraction Process
In the extraction process, the receiver uses the same parity assignment as that used in the embedding process to assign a k-bit parity to each color. The extraction process is as follows: Step 1: Divide the stego image into nonoverlapping blocks, each of which contains n × m pixels.
Step 2: Use Tanaka et al.'s parity assignment to assign a k-bit parity to each color in palette P.
Step 5: Set r to be the k secret data bits w.
Step 6: Repeat Steps 3 to 5 until all blocks are processed.
Because each block is used to embed secret data, the receiver does not require a location map in data extraction.

The Analysis for Embedding Capacities
As mentioned previously, both Imaizumi et al. [16] and Aryal et al.'s [17] methods need a location map in the extraction process; thus, the location map should be transmitted through another channel or be embedded in the stego image. However, it is unreasonable to transmit the location map through another channel. Thus, in the following, we only consider the location map embedded in the stego image. Let an image size be N × M, block size be n × m, the embedding bits for each block be k, then the total block number T = N × M/(n × m) . Assume that in the location map, each block is represented by one bit, 1 stand for the corresponding block used for embedding; 0 for skipping. Let X be the size of the location map, assume that the location map is embedded in the first [X/k] blocks, then the number of available blocks for secret data embedding is T − [X/k]. Thus, X should satisfy the following equation: Note that the embedding capacity (bits) is kX. Let an image size be 256 × 256 and block size be 2 × 2, then T = 16384. Let k = 3; through Equation (16), we can obtain X = 12, 288, that is, the number of available blocks for secret data embedding is 12,288, and the block number needed for recording the location map is 4096.

Experimental Results
In the experiments, 25 images of 256 × 256 in Figure 1 were used. These images were obtained from the Standard Image Database [26] or CBlR Image Database [27] and in the TIFF or JPG format. Photopea [18] was first used to resize and crop each image to 256 × 256, then Cloudconvert [18] was applied to convert TIFF (JPG) format into the GIF format. The embedded secret data were generated using a pseudorandom number generator. Image quality was measured using the peak signal-to-noise ratios (PSNRs). Chi-square attack, RS steganalysis, and embedding efficiency were used to measure the undetectability of a steganography method.

PSNR Comparisons
To demonstrate the effectiveness of our method, we conducted three experiments for comparing the image qualities of the proposed method with those of Imaizumi et al. [16] and Aryal et al. [17] under the same embedding capacity. The first two experiments assume that the location map needed by Imaizumi et al. and Aryal et al.'s methods is not embedded in the stego image, and it is sent through another channel. The third experiment assumes that the location map needed by Imaizumi et al. and Aryal et al.'s methods is embedded in the stego image; thus, the embedding capacity is reduced.
Photopea [18] was first used to resize and crop each image to 256 256, then Cloudconvert [18] was applied to convert TIFF (JPG) format into the GIF format. The embedded secret data were generated using a pseudorandom number generator. Image quality was measured using the peak signal-tonoise ratios (PSNRs). Chi-square attack, RS steganalysis, and embedding efficiency were used to measure the undetectability of a steganography method.

PSNR Comparisons
To demonstrate the effectiveness of our method, we conducted three experiments for comparing the image qualities of the proposed method with those of Imaizumi et al. [16] and Aryal et al. [17] under the same embedding capacity. The first two experiments assume that the location map needed by Imaizumi et al. and Aryal et al.'s methods is not embedded in the stego image, and it is sent through another channel. The third experiment assumes that the location map needed by Imaizumi et al. and Aryal et al.'s methods is embedded in the stego image; thus, the embedding capacity is reduced.
In the first experiment, Imaizumi et al.'s and the proposed methods with capacities of 15,000 and 30,000 bits were conducted. First, each image was divided into 128 128 blocks, each of which has size 2 2. Then, each block was embedded bits, 1, 2. Part of results is depicted in Tables 3   and 4. These tables reveal that the image qualities of the proposed method were the best. This means that the proposed method actually has lower embedding distortion for each block such that each In the first experiment, Imaizumi et al.'s and the proposed methods with capacities of 15,000 and 30,000 bits were conducted. First, each image was divided into 128 × 128 blocks, each of which has size 2 × 2. Then, each block was embedded k bits, k = 1, 2. Part of results is depicted in Tables 3 and 4. These tables reveal that the image qualities of the proposed method were the best. This means that the proposed method actually has lower embedding distortion for each block such that each block can be used for data embedding. In the following, more details of explanation are described. In Imaizumi et al.'s method, the palette is reordered; this increases the distance between two neighboring colors (i.e., two colors with index difference 1) when their indices are large. In data embedding, if one pixel's color c with index i is replaced by color c , then the index of c is i − 1 or i + 1. However, when i is large, these two colors with the index difference of 1 may not be close; this increases the embedding distortion.
To provide more explanation, the image Lena was used with setting k = 1. Figure 2 Figure 2b depicts the corresponding closest color with parity 1 of each color in Figure 2a. Figure 2d depicts the corresponding closest color with parity 0 of each color in Figure 2c. From these figures, we can determine that for each color with parity 0 (1), a similar color with parity 1 (0) can always be found. Figure 3 illustrates the result of Imaizumi et al.'s palette reordering. Figure 3a displays the reordered color palette. Figure 3b denotes the best replacing one of each color in Figure 3a when embedding data. Figure 3c illustrates the enlarged part of the rectangle marked by red color in Figure 3a. Figure 3d depicts the enlarged part of the rectangle marked by red color in Figure 3b. These figures indicate that some colors may be replaced by an unsimilar color during data embedding.
To provide more explanation, the image Lena was used with setting 1.  Figure 2b depicts the corresponding closest color with parity 1 of each color in Figure 2a. Figure 2d depicts the corresponding closest color with parity 0 of each color in Figure 2c. From these figures, we can determine that for each color with parity 0 (1), a similar color with parity 1 (0) can always be found.
(b) Corresponding closest color with parity 1 for each color in (a).
(d) Corresponding closest color with parity 0 for each color in (c).   Figure 3a displays the reordered color palette. Figure 3b denotes the best replacing one of each color in Figure 3a when embedding data. Figure 3c illustrates the enlarged part of the rectangle marked by red color in Figure  3a. Figure 3d depicts the enlarged part of the rectangle marked by red color in Figure 3b. These figures indicate that some colors may be replaced by an unsimilar color during data embedding.  In the second experiment, we compared the proposed method with the methods proposed by Imaizumi et al. [ Table 4, which reveals that the proposed method provides the best image quality under the same capacity. The reason is the same as that in experiment 1. Furthermore, our method modifies at most one pixel during data embedding; other methods [16,17] may modify more than one pixel during In the second experiment, we compared the proposed method with the methods proposed by Imaizumi et al. [16] and Aryal et al. [17] with a capacity of 45,000 bits and k = 3. Note that for the image Couple, only 43,845 bits can be embedded using Aryal et al.'s method. Part of results is listed in Table 4, which reveals that the proposed method provides the best image quality under the same capacity. The reason is the same as that in experiment 1. Furthermore, our method modifies at most one pixel during data embedding; other methods [16,17] may modify more than one pixel during data embedding.
As mentioned previously, Imaizumi et al. and Aryal et al.'s methods need an extra location map to record which blocks are used for embedding, in experiment 3, the location map is embedded into a stego image. According to Table 2 The main reason is that embedding the location map will occupy several blocks and reduce the embedding capacity. Thus, under the same embedding capacity, those blocks used for embedding the location map in Imaizumi et al. and Aryal et al.'s methods will be skipped for data embedding in the proposed method. This will make the proposed method have higher image quality.

Chi-Square Attack and RS Steganalysis
In steganography, the main goal for a stego image is statistically undetectable [21] (p. 52). To test whether the embedded images are detectable, chi-square attack [23], RS steganalysis [24], and embedding efficiency [21] were conducted. Chi-square attack and RS steganalysis are discussed in this section, and embedding efficiency in Section 5. Chi-square attack employs Pearson's chi-square test to determine whether there is a statistically significant difference between the expected frequencies and the observed frequencies in one or more categories of an image, and it can detect whether a palette image is embedded by messages. The details of applying the chi-square attack to steganography methods are described as follows: Step 1: Let the palette indices of a palette image be divided into K categories, each category contains a pair of indices (2i, 2i + 1), i = 0, . . . , K − 1. Let E i and O i be the theoretically expected and observed frequencies of pixels with index 2i after embedding messages, respectively. Then E i = The number of pixels with color index 2i or 2i + 1 2 , O i = The number of pixels with color index 2i.
Step 2: The χ 2 statistic is given as Step 3: Let p v represent the embedding probability, p v can be calculated by the following equation: In chi-square attack, the results for three methods are p v = 0; this means that the three methods can resist chi-square attack. There are two reasons: (1) These three methods are block-based; the embedding capacities are limited and lower than 1 bpp; this will make chi-square attack fail [21]; (2) chi-square attack is used to detect LSB-based methods, but these three methods are not LSB-based methods.
Chi-square attack just uses sample counts and neglects spatial correlations among pixels in the stego image. Fridrich et al. [24] introduced RS steganalysis for detection of LSB embedding that utilizes sensitive dual statistics derived from spatial correlations in image.
In RS steganalysis, for a given image I, through a given local mask, two flipping functions, and a discrimination function, all pixels of the image can be classified into three groups: Regular, singular, and unchanged. Given a non-negative mask m, we can obtain the relative frequency of the regular group denoted as R + and the relative frequency of the singular group denoted as S + . Then through the mask -m, we can obtain the relative frequency of the regular group denoted as R − and the relative frequency of the singular group denoted as S − . Let p e be the embedding rate in f, RS steganalysis can estimate p e by solving the following equation: where and R + (p/2) represents R + of a stego image with p pixels embedded (i.e., the LSBs of p/2 pixels flipped from a cover image). Thus, we can obtain R + (p e /2) easily through f ; furthermore, by flipping the LSB of each pixel in I to get I , we can also obtain R + (1 − p e /2) through I . S + , S − , and R − can be obtained by the similar way. Then, p e is calculated from the root z of Equation (20), whose absolute value is smaller, by the following equation: Two experiments are conducted, one for Imaizumi et al.'s [16] and the proposed methods uses block size 2 × 2 and three capacities (23%, 46%, and 69%); the other for Aryal et al.'s [17]  From these tables, we can see that RS steganalysis cannot estimate p e accurately. The reason is that these three methods are not LSB-based methods. We can conclude that the three methods can resist RS steganalysis and are undetectable.

Embedding Efficiency
Another measurement for undetectability is embedding efficiency [21]. The embedding efficiency is defined as the number of embedded random message bits per embedding change [21]. According to this definition, embedding efficiency (EF) can be expressed as follows: EF = number of embedding bits number of embedding pixel changes .
Methods with higher embedding efficiency are more undetectable, because under the same capacity, higher embedding efficiency methods will change less pixels than lower embedding efficiency methods. For k = 3, according to Equation (24), the estimated embedding efficiency of the proposed method (EF p ) can be calculated by Equation (25).
where p i stands for the probability of i pixel changed in a block, here p 0 = 1/8 and p 1 = 7/8. The estimated embedding efficiency of Imaizumi et al.'s method (EF i ) can be calculated by Equation (26).
The estimated embedding efficiency of Aryal et al.'s method (EF a ) can be calculated by Equation (27).

Conclusions
As mentioned previously, some BBMs produce large embedding distortions in some blocks; a location map is incorporated into these methods to record which blocks are used for data embedding. This will reduce the embedding capacity for secret data. To avoid this disadvantage, in this paper, we have proposed a BBM for palette images. The method modifies at most one pixel in a block. If modification is required, one optimal pixel with minimal embedding distortion is selected; this makes each block be used to embed secret data; that is, the embedding capacity of the proposed method is larger than that of the state-of-the-art BBMs. As to the undetectability, chi-square attack, RS steganalysis, and the embedding efficiency are used. Imaizumi et al.'s, Aryal et al.'s., and the proposed methods can resist chi-square attack and RS steganalysis. However, through the measure of embedding efficiency, both estimated and experimental efficiencies revealed that our method provided higher undetectability.