Reversible Data Hiding with a New Local Contrast Enhancement Approach

: Reversible data hiding schemes hide information into a digital image and simultaneously increase its contrast. The improvements of the different approaches aim to increase the capacity, contrast, and quality of the image. However, recent proposals contrast the image globally and lose local details since they use two common methodologies that may not contribute to obtaining better results. Firstly, to generate vacancies for hiding information, most schemes start with a preprocessing applied to the histogram that may introduce visual distortions and set the maximum hiding rate in advance. Secondly, just a few hiding ranges are selected in the histogram, which means that just limited contrast and capacity may be achieved. To solve these problems, in this paper, a novel approach without preprocessing performs an automatic selection of multiple hiding ranges into the histograms. The selection stage is based on an optimization process, and the iterative-based algorithm increases capacity at embedding execution. Results show that quality and capacity values overcome previous approaches. Additionally, visual results show how greyscale values are better differentiated in the image, revealing details globally and locally.


Introduction
Reversible data hiding (RDH) refers to concealing information in a host image and subsequently recovering both original elements. Reversibility is necessary, e.g., in medical and military areas or in any field in which permanent distortions of the image are not permitted. We can identify three basic types of RDH approaches [1], including lossless compression (LC) [2][3][4], difference expansion (DE) [5][6][7][8], and histogram shifting (HS) [9][10][11][12][13][14][15]. Previous methods have been combined to substantially improve results [8,14,[16][17][18][19][20]. In the context of HS schemes, the first HS technique described in [9] selects a range in the histogram between a peak-bin and a zero bin, and then, the bins in the open interval are shifted toward the zero bin to create a vacancy. Finally, the binary information is hidden between the peak bin and the adjacent empty bin. The hiding rate in bits is equal to the number of pixels with the maximum occurrence, which corresponds to the peak bin. Additionally, since the values of the pixel are shifted just by one, the hidden information is imperceptible.
The development of new RDH techniques mainly seeks an increment of the hiding rate with the preservation of the perceptual quality of the image. Nevertheless, some distortion might appear if a higher amount of information is embedded. To the best of our knowledge, authors in [21] discovered that HS techniques could increase contrast as a favorable distortion when embedding higher payloads and propose a method called RDH

•
Firstly, since the merged bins are not adjacent, the change in pixel values may cause some visual artifacts in the image; • Secondly, the position of the merged pixels must be saved to ensure reversibility; thus, a location map is generated and hidden into the histogram. Since the location map is the size of the image, it must be compressed; nevertheless, the payload capacity is reduced by the additional hidden information.
Based on the algorithm in [21], in the scientific literature, some RDH-CE techniques had been developed to increase capacity, improve the enhancement of contrast, and reduce undesirable distortions [24][25][26][27][28][29][30][31]. Most of the RDH-CE [21,[26][27][28][29][30][31] methods are focused on alleviating preprocessing drawbacks, such as distortion and capacity reduction caused by the location map. From our perspective, we consider that RDH-CE approaches without preprocessing are not explored sufficiently; moreover, the scheme in [25] has some important mechanisms that can be improved and extended. The proposed RDH-CE scheme of [25] selects a peak bin and a minimum bin in the histogram, avoiding the constraint of selecting a zero bin used in the HS approach. The range selection and embedding processes are iterated until all information is hidden. The shifting of the histogram at each iteration overlaps the minimum bin with its adjacent bin; therefore, it is necessary to save the location of the pixels whose values were overlapped. This information is contained in a location map that is hidden in conjunction with the payload. Since location maps are obtained from minimum bins, they are expected to be small.
In general, RDH schemes aim to simultaneously increase the capacity, contrast, and quality of the image. The present proposal was designed to improve these characteristics. On the one hand, previous RDH schemes [21,[24][25][26][27][28][29][30][31] hide the information in a few ranges of the histogram image. In contrast, we propose an algorithm that selects the greatest number of ranges possible in each histogram. The capacity can be increased since more ranges can hide more information. On the other hand, contrast is not just incremented but also visually improved since more ranges contain more peak bins that are spread and can be differentiated in the pixels of the contrasted image. Additionally, more ranges reduce the number of intermediate bins that are just shifted and decrease quality with no contribution to contrast. Furthermore, our proposal applies to optimal range selection on the raw histogram, avoiding preprocessing with unnecessary quality drops. Finally, the capacity is not restricted in advance because the algorithm is iterated over previous contrasted images, increasing the capacity in embedding execution. In this way, we denominate the scheme as multirange-level histogram shifting (MRLHS), considering that each iteration is called level, and the embedding process is achieved in multiple ranges of the histogram.
To adapt the proposal for practical use, we collect all the removal information, such as the peak bins, minimum bins, and other side data in a binary string. This information is hidden into the improved image to increase the contrast further and generate a smaller binary sequence to recover the information.
Results show that SSIM and PSNR qualities are better than previous approaches for almost all test images. Additionally, the capacity is considerably improved under similar contrast levels. Visual results show that the enhanced image better represents the local content of the original image, disclosing objects in the darkest and brightest areas and improving texture appearance.
The rest of this paper is organized as follows. Section 2 describes the basic HS method with zero bin. The proposed scheme is described in Section 3 and includes the HS with minimum bin (HS-MB) approach, the selection of the optimum set of ranges, and the Mathematics 2022, 10, 841 3 of 30 generation of the removal sequence. The experimental results are shown in Section 4, discussion in Section 5, and conclusions are presented in Section 6.

Embedding Process of the Conventional Histogram Shifting
Histogram shifting [9] selects a peak bin a and a zero bin b of the image histogram, as shown in Figure 1a, and embeds the binary information. In case a > b, the pixels of the image with values that are in the range [a + 1, b] are increased by 1; consequently, the histogram bins are shifted, as shown in Figure 1b. The peak bin a and the new vacant bin a + 1 are selected to embed a binary string. A pixel of the image with a value is increased by 1 or remains intact if the bit of the string that we want to embed is 1 or 0, respectively. If we have a binary string with six elements and the same number of 0 s and 1 s, bins a and a + 1 will have the same histogram value as shown in Figure 1c. Additionally, the capacity of the range selected in Figure 1 is 6 bits, which is equivalent to the histogram frequency h(a) in the peak bin a. content of the original image, disclosing objects in the darkest and brightest areas and improving texture appearance.
The rest of this paper is organized as follows. Section 2 describes the basic HS method with zero bin. The proposed scheme is described in Section 3 and includes the HS with minimum bin (HS-MB) approach, the selection of the optimum set of ranges, and the generation of the removal sequence. The experimental results are shown in Section 4, discussion in Section 5, and conclusions are presented in Section 6.

Embedding Process of the Conventional Histogram Shifting
Histogram shifting [9] selects a peak bin and a zero bin of the image histogram, as shown in Figure 1a, and embeds the binary information. In case > , the pixels of the image with values that are in the range [ + 1, ] are increased by 1; consequently, the histogram bins are shifted, as shown in Figure 1b. The peak bin and the new vacant bin + 1 are selected to embed a binary string. A pixel of the image with value is increased by 1 or remains intact if the bit of the string that we want to embed is 1 or 0, respectively. If we have a binary string with six elements and the same number of 0′s and 1′s, bins and + 1 will have the same histogram value as shown in Figure 1c. Additionally, the capacity of the range selected in Figure 1 is 6 bits, which is equivalent to the histogram frequency ℎ( ) in the peak bin . Using (1), the hiding process is applied in each pixel to hide a bit of information. The embedding in the pixels can be in a raster scan order, but not necessarily.
From (1), ( , ) and ( , ) are the original and the marked pixels, respectively, in the ( , ) coordinates of the image. ( ) is the q-th consecutive bit of the binary string that we want to hide in the pixel. To generalize, the coefficient determines the shifting direction, which must be from to , according to (2).

Reversibility Process of the Conventional Histogram Shifting
To read the binary string concealed in the image, we need to know the peak bin value and the peak bin value . Then, we read the hidden binary string ′ from the image Using (1), the hiding process is applied in each pixel to hide a bit of information. The embedding in the pixels can be in a raster scan order, but not necessarily.
From (1), I(m, n) and J(m, n) are the original and the marked pixels, respectively, in the (m, n) coordinates of the image. B(q) is the q-th consecutive bit of the binary string B that we want to hide in the pixel. To generalize, the coefficient d determines the shifting direction, which must be from a to b, according to (2).

Reversibility Process of the Conventional Histogram Shifting
To read the binary string concealed in the image, we need to know the peak bin value a and the peak bin value b. Then, we read the hidden binary string B from the image by applying (3) to each pixel in the coordinates (m, n). The reading order of the pixels must be in the order used in the embedding. Finally, to obtain the recovered image I from the marked image J we read each pixel in the position (m, n) in the correct order and then apply (4).

Reversible Data Hiding with Contrast Enhancement
The scheme in [25] can help to understand the basis of RDH-CE. Figure 2a shows a representation of an original histogram corresponding to an original image (Figure 2d). The preprocessing stage consists of selecting, shifting, and overlapping the several outer bins with the neighbor bins, as shown in Figure 2b. Then, two peak bins are identified and related with two corresponding zero bins that were generated in the preprocessing. In the embedding stage, histogram shifting is applied to each peak bin and zero bin pair. The process is repeated until there are no more vacancies in the outer bins. The resulting histogram is flatter (Figure 2c), and the contrast of the corresponding image is increased (Figure 2e), similar to histogram equalization approaches [22,23].  (3) to each pixel in the coordinates ( , ). The reading order of the pixels must be in the order used in the embedding.
Finally, to obtain the recovered image ′ from the marked image we read each pixel in the position ( , ) in the correct order and then apply (4).

Reversible Data Hiding with Contrast Enhancement
The scheme in [25] can help to understand the basis of RDH-CE. Figure 2a shows a representation of an original histogram corresponding to an original image (Figure 2d). The preprocessing stage consists of selecting, shifting, and overlapping the several outer bins with the neighbor bins, as shown in Figure 2b. Then, two peak bins are identified and related with two corresponding zero bins that were generated in the preprocessing. In the embedding stage, histogram shifting is applied to each peak bin and zero bin pair. The process is repeated until there are no more vacancies in the outer bins. The resulting histogram is flatter (Figure 2c), and the contrast of the corresponding image is increased (Figure 2e), similar to histogram equalization approaches [22,23]. Based on the general RDH description, schemes in [21,[24][25][26][27][28][29][30][31] propose different preprocessing, peak bin selections, or histogram generation stages in order to obtain better results.

Proposed RDH-CE Based on MRLHS
As shown in Figure 3, the embedding stage of the proposed algorithm consists of two MRLHS embedding blocks, each one followed by a removal sequence generator. Subsequently, the removal stage reverses the embedding process by applying two MRLHS removal blocks preceded by key readers. Based on the general RDH description, schemes in [21,[24][25][26][27][28][29][30][31] propose different preprocessing, peak bin selections, or histogram generation stages in order to obtain better results.

Proposed RDH-CE Based on MRLHS
As shown in Figure 3, the embedding stage of the proposed algorithm consists of two MRLHS embedding blocks, each one followed by a removal sequence generator. Subsequently, the removal stage reverses the embedding process by applying two MRLHS removal blocks preceded by key readers.  More specifically, the embedding stage is composed of the following four steps: 1. Embed the binary string into the image using the MRLHS embedding process. This produces an enhanced internal image and the removal information ; 2. Generate internal removal sequence from the removal information ; 3. Embed internal removal sequence into the image . This produces the enhanced image and the new removal information ; 4. Generate external removal sequence with the new removal information .
The data in removal information are binarized and placed into a removal sequence by a sequence generator, and the sequence reader recovers the information, as shown in Figure 3. The MRLHS embedding process and the sequence generator block are repeated twice for two reasons. The first one is that embedding the internal sequence in further increases the contrast of the image so that contrast of image is greater than the contrast of image . Secondly, internal removal sequence may be too large for practical use; by repeating the process, we obtain a smaller sequence which is delivered to the user. In this way, contains the removal information generated by embedding the binary string in , and contains the removal information generated by embedding in . The authorized user must have just the smaller sequence to reverse all the embedding processes.
The sequences and are just a binary representation of the concatenated removal information. We claim that proposing how to construct both sequences and know the length of the binary representation after the embedding process have some advantages. Firstly, the user can have an easier way to construct sequence , concatenate it to the payload , and embed them into the image. Secondly, we can easily know the size of sequence so the user can decide how to manage this information. Finally, some algorithms can be applied to the binary sequences, such as encryption, to increase security. However, as most of the RDH approaches [21,[24][25][26][27][28][29][30][31], the usage of security techniques is not included in the proposals since it depends on the user preferences and applications. One characteristic that may add some level of security in the present algorithm is that sequences and dynamically change according to the image, the information, and other parameters that are not known in advance.
On the other hand, the removal stage reverses the process of the embedding stage as shown in Figure 3 and is composed of the following four steps: 1. Read the information of the external removal sequence to obtain removal information ; 2. Extract the internal removal sequence and obtain an internally enhanced image ′; 3. Extract the information of the internal removal sequence to obtain new removal information ; 4. Extract the binary vector ′ and the image ′, which experimental results demonstrate are equal to the binary string and image , respectively. More specifically, the embedding stage is composed of the following four steps: 1.
Embed the binary string BS into the image I using the MRLHS embedding process. This produces an enhanced internal image Ji and the removal information RI; 2.
Generate internal removal sequence ki from the removal information RI; 3.
Embed internal removal sequence ki into the image Ji. This produces the enhanced image J and the new removal information RI; 4.
Generate external removal sequence k with the new removal information RI.
The data in removal information RI are binarized and placed into a removal sequence by a sequence generator, and the sequence reader recovers the information, as shown in Figure 3. The MRLHS embedding process and the sequence generator block are repeated twice for two reasons. The first one is that embedding the internal sequence ki in Ji further increases the contrast of the image so that contrast of image J is greater than the contrast of image Ji. Secondly, internal removal sequence ki may be too large for practical use; by repeating the process, we obtain a smaller sequence k which is delivered to the user. In this way, ki contains the removal information generated by embedding the binary string BS in I, and k contains the removal information generated by embedding ki in Ji. The authorized user must have just the smaller sequence k to reverse all the embedding processes.
The sequences k and ki are just a binary representation of the concatenated removal information. We claim that proposing how to construct both sequences and know the length of the binary representation after the embedding process have some advantages. Firstly, the user can have an easier way to construct sequence ki, concatenate it to the payload BS, and embed them into the image. Secondly, we can easily know the size of sequence k so the user can decide how to manage this information. Finally, some algorithms can be applied to the binary sequences, such as encryption, to increase security. However, as most of the RDH approaches [21,[24][25][26][27][28][29][30][31], the usage of security techniques is not included in the proposals since it depends on the user preferences and applications. One characteristic that may add some level of security in the present algorithm is that sequences k and ki dynamically change according to the image, the information, and other parameters that are not known in advance.
On the other hand, the removal stage reverses the process of the embedding stage as shown in Figure 3 and is composed of the following four steps:

1.
Read the information of the external removal sequence k to obtain removal information RI; 2.
Extract the internal removal sequence ki and obtain an internally enhanced image Ji ; 3.
Extract the information of the internal removal sequence ki to obtain new removal information RI; 4.
Extract the binary vector BS and the image I , which experimental results demonstrate are equal to the binary string BS and image I, respectively.
The general MRLHS embedding and removal blocks of Figure 3 are detailed in Figure 4a,b, respectively. The authors in [15] proved that using HS to embed information into blocks rather than into the complete image increases the ratio between visual quality and capacity. Therefore, we first divide the image I into F × C nonoverlapped blocks and obtain the histogram of each block, as shown in Figure 4a. To increase capacity, we select multiple ranges of each histogram and embed a segment of information at each range. Finally, to increase capacity in embedding execution, we repeat the process many times at subsequent iterations, which we call levels. Each level L conceals part of the information BS and further increases the contrast of the image because of the histogram redistributions. The algorithm repeats the embedding level until BS is totally hidden and finally obtains an enhanced image, as well as the removal information RI. The data in RI contain the parameters F, C, L, the length of BS, and the selected ranges, which are used for the reversibility of the proposed method, as illustrated in Figure 4b.
The general MRLHS embedding and removal blocks of Figure 3 are detailed ure 4a and 4b, respectively. The authors in [15] proved that using HS to embe mation into blocks rather than into the complete image increases the ratio between quality and capacity. Therefore, we first divide the image I into × nonove blocks and obtain the histogram of each block, as shown in Figure 4a. To increase c we select multiple ranges of each histogram and embed a segment of information range. Finally, to increase capacity in embedding execution, we repeat the proces times at subsequent iterations, which we call levels. Each level conceals part o formation and further increases the contrast of the image because of the his redistributions. The algorithm repeats the embedding level until is totally hidd finally obtains an enhanced image, as well as the removal information . The da contain the parameters , , , the length of , and the selected ranges, which a for the reversibility of the proposed method, as illustrated in Figure 4b.  In the proposed RDH embedding stage of Figure 4a, the contrast of the imag hanced, but an undesirable block effect may appear and grow when the embeddin increases, as shown in Figure 5b. This effect occurs if the blocks are selected at th position in the progressive levels. Then, to diminish this effect and at the same t prove the visual quality of the enhanced image, we propose shifting the position blocks at each increment of level L. First, starting with the original image, we se blocks considering null shifting and proceed to the first data hiding round, obtai enhanced image of level = 1. Then, if data are not totally embedded into hanced image, we select the blocks shifted vertically and horizontally the amoun In the proposed RDH embedding stage of Figure 4a, the contrast of the image is enhanced, but an undesirable block effect may appear and grow when the embedding level increases, as shown in Figure 5b. This effect occurs if the blocks are selected at the same position in the progressive levels. Then, to diminish this effect and at the same time improve the visual quality of the enhanced image, we propose shifting the position of the blocks at each increment of level L. First, starting with the original image, we select the blocks considering null shifting and proceed to the first data hiding round, obtaining an enhanced image of level L = 1. Then, if BS data are not totally embedded into the enhanced image, we select the blocks shifted vertically and horizontally the amount of 1/2 their vertical and horizontal size, respectively; if another round of data hiding is needed, then the next shifting step considers a ratio of 1/4 and so on. Therefore, the ratios to shift the block positions in each level are based on the sequence (0, 1/2, 1/4, 3/4, 1/8, 3/8, 5/8, 7/8, 1/16, 3/16, 5/16, 7/16 . . . .). The shifting sequence avoids the overlapping of the block edges at each embedding level and reduces the block effect. For illustrative purposes, in Figure 5c, we show several advantages when performing block shifting selection. The total levels needed for embedding are less, and therefore, quality increases and processing time decreases.
their vertical and horizontal size, respectively; if another round of data hiding is needed, then the next shifting step considers a ratio of 1/4 and so on. Therefore, the ratios to shift the block positions in each level are based on the sequence (0, 1/2, 1/4, 3/4, 1/8, 3/8, 5/8, 7/8, 1/16, 3/16, 5/16, 7/16….). The shifting sequence avoids the overlapping of the block edges at each embedding level and reduces the block effect. For illustrative purposes, in Figure  5c, we show several advantages when performing block shifting selection. The total levels needed for embedding are less, and therefore, quality increases and processing time decreases.    In Section 3.1, we explain the embedding process at each range, which is an improvement of the proposal in Section 2. The proposed HS approach considers a range with a minimum bin instead of a zero bin. This allows us to increase the number of ranges into one histogram and, therefore, obtain more capacity and contrast. In Section 3.2, we explain the selection of the optimum set of ranges with minimum bins to hide the information in the histograms. This process is achieved using a decision table that optimizes the trade-off between capacity and quality. Finally, in Section 3.3, we propose the removal sequence generator and reader blocks shown in Figure 3.

Embedding Process of the Conventional Histogram Shifting
If we divide the histogram into ranges, we may find just a few with zero bin as described in Section 2.2. Therefore, the proposal in [25] selects a range that has minimum bins with values different from zero. In this way, we can select more than one range and increase the capacity of the histogram.
However, in the shifting process, the minimum bin and its adjacent bin are overlapped. Therefore, to achieve the complete reversibility of the hiding process, it is necessary to save the positions of the pixels in which values are merged. In our HS-MB, we propose to generate a header with the position information and hide it with the payload into the corresponding range.

HS-MB Embedding
If the histogram does not have a zero bin b to define a range, we propose selecting a minimum bin b whose histogram frequency h(b) is equal or different from zero, as shown in Figure 6a, where h(b) = 1. Then, the range [a + 1, b − 1] is shifted, as shown in Figure 6b, and the binary string is concealed in the bins a and a + 1 according to (1). As an example, if we hide a binary string with two zeros and four ones, the histogram changes, as shown in Figure 6c.

HS-MB Embedding
If the histogram does not have a zero bin to define a range, we propose selecting a minimum bin whose histogram frequency ℎ( ) is equal or different from zero, as shown in Figure 6a, where ℎ( ) = 1. Then, the range [ + 1, − 1] is shifted, as shown in Figure 6b, and the binary string is concealed in the bins and + 1 according to (1). As an example, if we hide a binary string with two zeros and four ones, the histogram changes, as shown in Figure 6c. When the range [ + 1, − 1] in Figure 6a is shifted, the bins − 1 and overlap as shown in Figure 6b, where ℎ( ) = 2. This means that the pixels in the original image with values − 1 and equal to after the shifting process. To completely recover the image in the removal process, it is necessary to know which pixels were equal to − 1 and before shifting. Therefore, we propose to save this information in a header and concatenate it before the payload . Then, the concatenated string is concealed in the bins and + 1. Therefore, we need to define the elements of that indicate the original pixel values of the overlapped bins. To generalize, value in (2) indicates the shifting direction and defines de minimum bin and its adjacent bin − . The first two bits of will indicate the original state of bins − and . If the bin in − is a zero bin, then the first bit (1) equals 0, and 1 otherwise, as shown in (5). If the bin in is a zero bin, then the second bit (2) equals 0, and 1 otherwise, as shown in (6). The next bits in will indicate which pixel values of the original image were − or before shifting. The pixels of the original image are scanned in a defined order, and when the -th consecutive pixel with value − or is found, the next bit (2 + ) is set to 1 or 0, respectively, as shown in (7). To completely recover the image in the removal process, it is necessary to know which pixels were equal to b − 1 and b before shifting. Therefore, we propose to save this information in a header H and concatenate it before the payload B. Then, the concatenated string HB is concealed in the bins a and a + 1.
Therefore, we need to define the elements of H that indicate the original pixel values of the overlapped bins. To generalize, value d in (2) indicates the shifting direction and defines de minimum bin b and its adjacent bin b − d. The first two bits of H will indicate the original state of bins b − d and b. If the bin in b − d is a zero bin, then the first bit H(1) equals 0, and 1 otherwise, as shown in (5). If the bin in b is a zero bin, then the second bit H(2) equals 0, and 1 otherwise, as shown in (6). The next bits in H will indicate which pixel values of the original image were b − d or b before shifting. The pixels of the original image are scanned in a defined order, and when the p-th consecutive pixel with value b − d or b is found, the next bit H(2 + p) is set to 1 or 0, respectively, as shown in (7).
The binary string HB that concatenates the header H and the information B is defined in (8). If the first two elements of H are equal to 1, it means that there are overlapped bins after shifting, and we must save the rest of the string H; otherwise, it is not necessary. This strategy considerably reduces the length of the header H in case we do not have overlapped pixels to be differentiated.
In the example of Figure 6a, H(1) = 1 and H(2) = 1, the rest of H has a length of 2 because we have two overlapped pixels that we must distinguish in the removal process. These two values H(3) and H(4) depend on which pixel is found first in the original image, b − d or b, in the scanning order. For example, if we find b value first, then H(3) = 1 and H(4) = 0. Therefore, the total length of H is two plus the number of pixels with overlapped values, which is Since we must conceal the information contained in H, the net capacity of the range is reduced. For the example in Figure 6, the absolute capacity is h(a) = 6 but 4 bits are used to conceal the header H, and consequently, we have a net capacity equal to 2 bits. Hence, the net capacity C is the absolute capacity h(a) of the range minus the length of H as follows: Once we have HB, the embedding process is achieved using (1) with HB instead of B, and the length of B must be less or equal to the net capacity C.
Finally, we define the distortion D of the range as the number of pixels affected by the shifting process. This value is defined in (10) as the sum of all the histogram values in the

HS-MB Removal
The removal process is divided into two steps, the reading of the concealed information and the image recovering. For the first step, each consecutive q-th value of the extracted string HB is obtained by reading the value of each pixel in the position (m, n) in the order used in the embedding process, as follows: The recover payload B is obtained by reading the elements of HB from the position after the header, as follows: To obtain the recovered image I we must read each pixel J(m, n) of the marked image J in the order defined in the embedding process, and calculate each pixel I (m, n) as follows: where p is the consecutive number of the found pixel whose value equals b. The conditions given in (10) are defined as:  The first condition corresponds to the bins that are shifted, as the black ones in Figure 6a. The second condition separates bins in case they are overlapped. Finally, condition 3 corresponds to the bins that must remain, as represented in gray lines in Figure 6.

Selection of Optimal Set of Ranges
In this section, we propose to select a set of ranges per histogram and conceal information in each one of them using the HS-MB technique. This may have two advantages: first, we can increase the total capacity of hidden information, and secondly, the marked histogram will be more distributed, which will cause a better increment in the image contrast.
Better contrast increment is one of the main advantages when selecting multiple ranges at one embedding iteration. Proposals in [21,[24][25][26][27][28][29][30][31] select one or few ranges, and the contrast is only incremented by the few peak bins that spread to their adjacent bins. Additionally, since the difference between the peak bin and the minimum bin tend to be large, all the intermediate bins that are shifted do not contribute to increasing the contrast ratio. Therefore, selecting more ranges increases the number of peak bins that contribute to improving contrast and decreases the number of intermediate bins. As a result, more grayscale values can be differentiated from each other in the image after the embedding process. In Section 4.5, we compare the results of both approaches and show that selecting many ranges contributes to increasing the local details of the image.
We use the histogram in Figure 7a as an example. In Figure 7b, we selected one range with the peak bin a 1 and the zero bin b 1 that define the range whose capacity is equivalent to 14 bits using the HS zero bin technique. On the other hand, in Figure 7c, we select three peak bins a 1 , a 2 , and a 3 with their corresponding minimum bins b 1 , b 2 , and b 3 , respectively. The capacity of each range according to (9) is 4, 4, and 12 bits, respectively, and the total capacity is 20 bits, greater than the capacity of the range selected in Figure 7b. To show the histogram distribution, Figure 7d,e shows the marked histograms using the ranges of Figure 7b,c, respectively. We can see that the histogram in Figure 7e is less sharp than that of Figure 7d since more peak bins were distributed.
Since there is more than one range, we define the total capacity C T of the set with p ranges as the sum of the individual capacities of all ranges as follows: where C s is the capacity of the s-th range calculated by (9). The number of sets of ranges that we can use to hide information may be large. For example, if we select in the histogram of Figure 7a the peak bin a with value 12, we can select a minimum bin b equal to 0, 1, 2 3, 4, 5, 6, 8, 9, 14, 15, 16, 17, 18, or 19, so we have 15 possible options. Using an exhaustive calculation for the histogram of Figure 7a, we found that the number of possible range sets using just one peak bin at a time (a equals 2, 7, 11, 12, or 16) is 59. If we add the number of possible sets using two to five peak bins, we obtain 1509 possibilities. One of the main objectives of the present proposal is to choose the better possibility, the one that has the maximum capacity with the minimum distortion to the image. Therefore, finding all possibilities and selecting the best may be exhaustive for histograms with bins in the range 0-255. To solve this problem, we propose an optimization method that selects an initial range and updates it with a new set of ranges that increase capacity at each iteration. Since there is more than one range, we define the total capacity of the set with ranges as the sum of the individual capacities of all ranges as follows: where is the capacity of the -th range calculated by (9). The number of sets of ranges that we can use to hide information may be large. For example, if we select in the histogram of Figure 7a the peak bin with value 12, we can select a minimum bin equal to 0, 1, 2 3, 4, 5, 6,8,9,14,15,16,17,18, or 19, so we have 15 possible options. Using an exhaustive calculation for the histogram of Figure 7a, we found that the number of possible range sets using just one peak bin at a time ( equals 2, 7, 11, 12, or 16) is 59. If we add the number of possible sets using two to five peak bins, we obtain 1509 possibilities. One of the main objectives of the present proposal is to choose the better possibility, the one that has the maximum capacity with the minimum distortion to the image. Therefore, finding all possibilities and selecting the best may be exhaustive

Optimization Process
In this section, we explain the main iterative process to find the best set of ranges. We will define two vectors a = a 1 , a 2 , . . . a s , . . . , a p and b = b 1 , b 2 , . . . b s . . . , b p whose p elements are the peak bins and minimum bins, respectively, arranged in descending order. For example, the vectors for the range in Figure 7b [3,9,19].
The iterative process is shown in Figure 8 and described as follows. First, we initialize vector a with the bin of the maximum value max{h(g)} of the histogram, and vector b with the bin that corresponds to the minimum value min{h(g)}. Having the vectors a and b, we select the next peak bin a t different from the previously selected. Using the decision Table 1, we find the minimum bin b t and incorporate a t and b t in new vectors a t and b t . If the total capacity C T that corresponds to vectors a t and b t is greater than the total capacity C T of the current vectors a and b, we update them as follows: [19]; on the other hand, the vectors of the ranges in Figure 7e are = [ , , ] = [7,11,12] and = [ , , ] = [3,9,19].
The iterative process is shown in Figure 8 and described as follows. First, we initialize vector with the bin of the maximum value max {ℎ( )} of the histogram, and vector with the bin that corresponds to the minimum value min {ℎ( )}. Having the vectors and , we select the next peak bin different from the previously selected. Using the decision Table 1, we find the minimum bin and incorporate and in new vectors and . If the total capacity that corresponds to vectors and is greater than the total capacity of the current vectors and , we update them as follows:  If the capacity were not improved, we would select the next peak bin a t and repeat the process. The process continues until one of the following conditions occurs: the desired capacity is reached, the capacity does not increase anymore, or the stop condition h(a t ) ≤ V pmax{h(g)} is achieved. The stop value V p ∈ [0, 1] may stop iterations; if we decrease the value, the range selection time decreases, but the total capacity may not be the maximum possible.
The decision table finds the new minimum bin b t and assign it to a t or to a previous peak bin, according to some conditions. First, we find in the table which condition a t complies in conjunction and then calculate the corresponding test minimum bin b t and the test vectors a t and b t . The first condition refers to the position of a t in the histogram with respect to other bins in vectors a and b. The second condition assures that the peak bin a t is sufficiently separated from another peak bin to search between them for the new minimum bin b t . The third condition looks for previously selected bins close to a t to decide if b t will be assigned to a t or to another peak bin. There are some important considerations. Firstly, some cases just need the compliance of one or two conditions. Secondly, if a t complies with more than one set of conditions, we must choose the one that improves capacity C T .
Additionally, we will define a programming function that searches the best minimum bin b t for a given peak bin a in a defined range [limin f , limsup] as follows: The Equation (16) must discard the bins in the range [a − d, a + d] since we need at least two bins (a and adjacent) to conceal the information. If the function finds two or more options for b with the same capacity C ((9)), it must select the one with less distortion D ((10)).

Generation and Reading of Removal Sequences
As mentioned above, the information to extract the hidden data and recover the original image is contained in the internal and user removal sequences. The user removal sequence k contains the information to remove the internal removal sequence ki and subsequently is used to remove the hidden information BS from the enhanced image. Section 3.3.1 explains the generation process of the internal removal sequence ki, and Section 3.3.2 describes how to recover the information from ki.

Generation of Internal and User Removal Sequence
For the sake of brevity, we explain the process to generate internal removal sequence ki; however, note that this procedure also applies to building the user removal sequence k.
(nbran): Total bits to represent the number of ranges per block; 9.
(nba): Total bits to represent the peak bins; 10. (nbb): Total bits to represent the minimum bins.
The flag sep is a user-selected value that delimits the parameters into the removal sequence ki, used for reversibility. The flags sepr1, sepr2, . . . contain the number of ranges appointed to each block, number 1, 2, . . ., respectively. The parameter nbran is in the function of the maximum possible number of ranges maxNR contained in each block, nbran = log 2 (maxNR + 1) , where · is the nearest upper integer. Values nba and nbb are obtained using the maximum values maxa and maxb in a and b, respectively, determined by nba = log 2 (maxa + 1) and nbb = log 2 (maxb + 1) .
The peak bins (a11, a12, a13, . . . a21, a22, a23, . . .) and the minimum bins (b11, b12, b13, . . . b21, b22, b23, . . .) are the values contained in vectors a and b, whose notation is given by the letters a and b followed by the number of the range as well as the number of the level, respectively, e.g., a23 represents the peak bin of the range number 2 in the enhanced image of level L = 3.
The order of the data into the removal sequence ki is given by (18

Reading of Internal and User Removal Sequence
The internal removal sequence ki is segmented by detecting the location of the flag values sep contained within the binary string. The first seven segments between sep values correspond to F, C, L, G, nbran, nba, and nbb according to (17). Subsequently, we read the next nbran number of bits, and the read value corresponds to sepr1. We read the next nba bits consecutively sepr1 times, and the next nbb bits sepr1 times to extract the peak and minimum bins, respectively, as shown in (17). Again, we read the next nbran number of bits to read the value corresponding to sepr2, and the process is repeated until the end of the string. The extracted peak bins a11, a12, a13, . . . a21, a22, a23, . . . and minimum bins  b11, b12, b13, . . . b21, b22, b23, . . . are the elements of the vectors a and b in the corresponding block and level.

Experimental Results
Experimental results were performed on USC-SIPI [32] dataset composed of eight images of 512 × 512 in size, Kodak Lossless True Color Image Suite [33] that contain 24 images of 768 × 512 in size, and BOWS-2 dataset [34] with five images of 512 × 512 in size, all images have 8-bit depth grayscale. We conducted several experiments to evaluate the proposed algorithm in terms of capacity and visual quality. First, we presented the assessment metrics and parameter settings. Then, we evaluated and discussed the results on three common individual images. Finally, we presented a comparison performance with eight previous methods reported in the state-of-the-art proposals [21,[24][25][26][28][29][30][31], showing that our proposal outperforms all of them and gives new visual quality benefits.

Assessment Metrics to Contrast-Enhancement and Visual Quality
The goal of the data hiding schemes with contrast enhancement is to embed information and, at the same time, enhance the contrast of the image. To assess the contrast increment of the enhanced image, we used the relative entropy error (REE), the relative mean brightness error (RMBE), and the relative contrast error (RCE) [27]. REE is in the range [0, 1], where REE > 0.5 means that the entropy of the image has been increased. For the user, the RMBE metric measures the change of the brightness in the image, RMBE = 1 indicates that the brightness has not been changed, RMBE < 1 indicates that the brightness has been altered. Finally, RCE measures the contrast change, and RCE > 0.5 shows an increment in the contrast of the enhanced image. To evaluate the visual quality of the image, we used a nonreferenced metric called Blind/Reference-Less Image Quality Evaluator (BRISQUE) [35], which measures the damage caused by noise and blurring into the images without any reference. Finally, we employed the well-known reference quality metrics called Peak Signal-to-Noise Ratio (PSNR) and the Structural Similarity Index (SSIM) [36], which are applied to the enhanced image with respect to the original image.

Parameters Settings
Based on several experiments, we recommend the set of parameters shown in Table 2, which are used in the experimental results. The parameters that most affect the performance are F and C and can be selected according to the application. In Figure 9, we hide 0.8 bpp in the Lena image and showed how F × C number of blocks, when hiding the binary string BS, affect quality and processing time, considering F = C. The three black curves correspond to different values of F (2, 4, and 8) when hiding the binary string BS. Additionally, the red lines represent the quality decrement when hiding the internal removal sequence with F = 1 after hiding BS. Finally, each marker is the transition between embedding levels.
how × number of blocks, when hiding the binary string , affect quality and processing time, considering = . The three black curves correspond to different values of (2, 4, and 8) when hiding the binary string . Additionally, the red lines represent the quality decrement when hiding the internal removal sequence with = 1 after hiding . Finally, each marker is the transition between embedding levels. We can see in Figure 9 that if we define = 8 for embedding, the quality is higher, but the processing time increases. On the other hand, if we define = 2, the quality is less, and the embedding process is faster. Additionally, the level 'markers' for = 2 are closer, which means the capacity at each level decreases faster. This might cause the maximum capacity to be reached before embedding all the information, and therefore, we do not recommend a small number of blocks for higher payloads. Since most RDH-CE consider quality more important than processing time, the results for comparison are obtained using = 8. Table 3 shows different qualitative results using different values of . We can see that the lengths of the removal sequences and increase when F and C are increased. However, the length of the user removal sequence k remains under 5% of the length of the internal removal sequence ki, which proves the effectiveness of the internal removal sequence hiding process. We can see in Figure 9 that if we define F = 8 for BS embedding, the quality is higher, but the processing time t increases. On the other hand, if we define F = 2, the quality is less, and the embedding process is faster. Additionally, the level 'markers' for F = 2 are closer, which means the capacity at each level decreases faster. This might cause the maximum capacity to be reached before embedding all the information, and therefore, we do not recommend a small number of blocks for higher payloads. Since most RDH-CE consider quality more important than processing time, the results for comparison are obtained using F = 8. Table 3 shows different qualitative results using different values of F. We can see that the lengths of the removal sequences ki and k increase when F and C are increased. However, the length of the user removal sequence k remains under 5% of the length of the internal removal sequence ki, which proves the effectiveness of the internal removal sequence hiding process.

Performance on Individual Images
One condition that cannot be controlled in advance and may affect the performance is the histograms distribution of the original image. Figure 10a-c shows F-16, Lena, and Baboon images, respectively, with a block rounded in red. Figure 10d-f shows, with a black line, the distribution of the histogram in the selected squares that corresponds to each image. Additionally, the red lines correspond to the distributions after embedding the information with the present RDH-CE proposal. Since the three images have different sharpness in the original histogram, we use them to test performance.

Performance on Individual Images
One condition that cannot be controlled in advance and may affect the performance is the histograms distribution of the original image. Figure 10a-c shows F-16, Lena, and Baboon images, respectively, with a block rounded in red. Figure 10d-f shows, with a black line, the distribution of the histogram in the selected squares that corresponds to each image. Additionally, the red lines correspond to the distributions after embedding the information with the present RDH-CE proposal. Since the three images have different sharpness in the original histogram, we use them to test performance.  Figure 11 shows the contrast RCE, the nonreferenced quality BRISQUE, and the referenced qualities PSNR and SSIM applied to the images in Figure 10a-c after hiding information. The size of the embedded payload goes from 0.1 to 0.8 bpp of information. We can see in Figure 11a,d,g,j, F-16 image with the sharpest histograms is not considerably  Figure 11 shows the contrast RCE, the nonreferenced quality BRISQUE, and the referenced qualities PSNR and SSIM applied to the images in Figure 10a-c after hiding information. The size of the embedded payload goes from 0.1 to 0.8 bpp of information. We can see in Figure 11a,d,g,j, F-16 image with the sharpest histograms is not considerably altered. This is because we have more capacity given by higher peak bins when hiding information. On the other hand, Figure 11b,e,h,k show higher image modification after embedding information. Finally, Figure 11c,f,i,l shows the results for the Baboon image, which is considerably altered. This is because the peak bins are smaller, and the algorithm needs more levels to hide the information. Figure 12 shows the visual results of the three images considering a fixed hiding rate of 0.8 bpp with F = 8 for BS embedding and F = 1 for embedding the removal sequence ki. From left to right, the first column in Figure 12 shows the original images and the initial RCE, BRISQUE, PSNR, and SSIM values. The second column shows the results for the images with the BS string hidden, and the third column shows the results for the image with the BS and ki data concealed. We can see how the contrast is increased.
altered. This is because we have more capacity given by higher peak bins when hiding information. On the other hand, Figure 11b,e,h,k show higher image modification after embedding information. Finally, Figure 11c,f,i,l shows the results for the Baboon image, which is considerably altered. This is because the peak bins are smaller, and the algorithm needs more levels to hide the information.   Figure 12 shows the visual results of the three images considering a fixed hiding rate of 0.8 bpp with = 8 for embedding and = 1 for embedding the removal sequence . From left to right, the first column in Figure 12 shows the original images and the initial RCE, BRISQUE, PSNR, and SSIM values. The second column shows the results for the images with the string hidden, and the third column shows the results for the image with the and data concealed. We can see how the contrast is increased.

Computational Complexity (Speed)
Our method has been implemented using MATLAB© R2018a on a Notebook with an Intel© i5-8250U processor (1.6 GHz) and 8 GB random access memory (RAM). The three main parameters that may affect processing time are hiding rate, number of blocks, and image size. Additionally, one factor that considerably affects the speed of the embedding and removal procedures is histogram distribution; however, the latter depends on image content, and we cannot control it. Figures 13 and 14 show three curves that correspond to the F-16 and Baboon images (size 512 × 512) shown in Figure 10a,c, and a curve which is the average results of the 24 images in the Kodak dataset (resized to 512 × 512). In all graphs, Baboon shows to have the highest processing times since it has high distributed histograms with reduced initial capacity, as shown in Figure 10f; consequently, the algorithm needs more iterations and time to hide the information. In contrast, the F-16 image contains sharper histograms, as shown in Figure 10d, and therefore, the processing is faster.
Our method has been implemented using MATLAB© R2018a on a Notebook with an Intel© i5-8250U processor (1.6 GHz) and 8 GB random access memory (RAM). The three main parameters that may affect processing time are hiding rate, number of blocks, and image size. Additionally, one factor that considerably affects the speed of the embedding and removal procedures is histogram distribution; however, the latter depends on image content, and we cannot control it. Figures 13 and 14 show three curves that correspond to the F-16 and Baboon images (size 512 × 512) shown in Figure 10a,c, and a curve which is the average results of the 24 images in the Kodak dataset (resized to 512 × 512). In all graphs, Baboon shows to have the highest processing times since it has high distributed histograms with reduced initial capacity, as shown in Figure 10f; consequently, the algorithm needs more iterations and time to hide the information. In contrast, the F-16 image contains sharper histograms, as shown in Figure 10d, and therefore, the processing is faster. Figure 13a shows the embedding time according to the hiding rate; as expected, time increases when we raise the length of the concealed information. Figure 13b shows that if we increase the number of blocks ( × ), the embedding time also increases, and, as previously discussed in Figure 9, the quality of the image may be improved. To measure how the image size affects processing time, Figure 13c shows the case in which the hiding rate is 0.5 bpp; to maintain this value constant, we must increase the length of the embedded information, and consequently, time increases too. Finally, Figure 14 shows a sparse graph that compares embedding time with the removal time of the points in Figure 13a. The relation seems to be linear and independent of the histogram distribution between images. The experiment shows that the removal process lasts approximately 0.46 times the embedding stage, on average.

Performance Comparison
Comparisons of performance between our proposal and those most recent sche [21,[24][25][26][28][29][30][31] are shown in Tables 4-8. Values in the grids are highlighted in bold s to indicate they outperform in the comparison. The proposals in [21,[24][25][26][28][29][30][31] based on a preprocessing that determines S shifting iterations to conceal the data bits a fair comparison, our proposal embeds a similar hiding rate to that obtained by diffe values of S. The metrics used in the results are described in Section 4.1. Table 4 reports experimental results on average for the USC-SIP dataset and Tab for the Kodak dataset. Additionally, we consider the recommended parameters of T 4 and define = = 8 for embedding. We can see that values RCE, REE, and RM  Figure 13a shows the embedding time according to the hiding rate; as expected, time increases when we raise the length of the concealed information. Figure 13b shows that if we increase the number of blocks (F × C), the embedding time also increases, and, as previously discussed in Figure 9, the quality of the image may be improved. To measure how the image size affects processing time, Figure 13c shows the case in which the hiding rate is 0.5 bpp; to maintain this value constant, we must increase the length of the embedded information, and consequently, time increases too.
Finally, Figure 14 shows a sparse graph that compares embedding time with the removal time of the points in Figure 13a. The relation seems to be linear and independent of the histogram distribution between images. The experiment shows that the removal process lasts approximately 0.46 times the embedding stage, on average.

Performance Comparison
Comparisons of performance between our proposal and those most recent schemes [21,[24][25][26][28][29][30][31] are shown in Tables 4-8. Values in the grids are highlighted in bold style to indicate they outperform in the comparison. The proposals in [21,[24][25][26][28][29][30][31] are based on a preprocessing that determines S shifting iterations to conceal the data bits. For a fair comparison, our proposal embeds a similar hiding rate to that obtained by different values of S. The metrics used in the results are described in Section 4.1.  Table 7. Average metrics using the images of Figure 15 F, C = 8.  Table 8. Average metrics using the images of Figure 15 and F, C = 1.  Table 4 reports experimental results on average for the USC-SIP dataset and Table 5 for the Kodak dataset. Additionally, we consider the recommended parameters of Table 4 and define F = C = 8 for BS embedding. We can see that values RCE, REE, and RMBE for our proposal are close to those obtained in other schemes; nevertheless, the proposed method enhances the contrast differently, as shown later. The values of the nonreferenced quality metric BRISQUE are the worst in our proposal because the algorithm amplifies noises that are unseen in the original image. As shown in Table 4, the quality SSIM and PSNR are less but similar for the USC-SIP database, which contains eight test images. However, if we increase to 24 images using the Kodak dataset, we can see in Table 5 that our SSIM and PSNR values increase and become better than in other approaches.

Hiding
If we want to increase contrast and maintain the same hiding rate, we can decrease the number of blocks (with F, C), but the capacity is more restricted, as discussed in Section 4.2. However, Table 6 shows results obtained using the Kodak dataset and recommended block division from Table 2 as F = C = 1. We can see that contrast becomes closer to other proposals and, in some cases, is higher. SSIM and PSNR values continue being the best even with the number of blocks decreasing.
Considering a set of five test images shown in Figure 15, a performance comparison in terms of average RCE, REE, RMBE, SSIM, and PSNR, with schemes from [19,24,26,28] is shown in Tables 7 and 8, using F = C = 8 and F = C = 1 for the BS embedding, respectively. From Tables 7 and 8, we show that the metrics RCE, REE, and RMBE indicate less contrast obtained by our proposal when F, C = 8 and a gained contrast revealed by the metric REE when F, C = 1. On the other hand, in all cases, the values of the SSIM and PSNR metrics obtained by our proposal outperform the algorithms in [24,26,28,29], resulting in a good visual quality of enhanced images. PSNR metrics obtained by our proposal outperform the algorithms in [24,26,28,29], resulting in a good visual quality of enhanced images.   Table 8. Average metrics using the images of Figure 15 and , = 1. For illustrative purposes, in Figures 16-18, we can see a visual comparison between schemes [21,31] and the proposed method, using a couple of images from USC-SIP and Kodak datasets, respectively. From Figures 16 and 17, we show that methods [21,31] and our proposal obtain a similar value of RCE in all cases. On the other hand, the scheme reported in [21] and the proposed method outperforms [31] in terms of BRISQUE, both keeping a consistent value of this metric. However, the proposed method has several advantages over [21,31] in terms of visual quality and capacity. By a naked eye, from Figures  16 and 17, we show that our method enhances the contrast of the images obtaining a sharp definition to the edges, contours, and textures without damaging the luminance in dark and bright areas, compared with the results obtained by [21,31]. In this context, by a naked eye, we can see that the scheme [21] causes false contours in the images. For the user, the method in [31] does not reveal content in the regions with low and high luminance, as shown in Figure 18. For illustrative purposes, in Figures 16-18, we can see a visual comparison between schemes [21,31] and the proposed method, using a couple of images from USC-SIP and Kodak datasets, respectively. From Figures 16 and 17, we show that methods [21,31] and our proposal obtain a similar value of RCE in all cases. On the other hand, the scheme reported in [21] and the proposed method outperforms [31] in terms of BRISQUE, both keeping a consistent value of this metric. However, the proposed method has several advantages over [21,31] in terms of visual quality and capacity. By a naked eye, from Figures 16 and 17, we show that our method enhances the contrast of the images obtaining a sharp definition to the edges, contours, and textures without damaging the luminance in dark and bright areas, compared with the results obtained by [21,31]. In this context, by a naked eye, we can see that the scheme [21] causes false contours in the images. For the user, the method in [31] does not reveal content in the regions with low and high luminance, as shown in Figure 18.        [21], (c,g) [31], and (d,h) the present proposal. Figure 18. Zoomed parts of some original images (left column), enhanced images obtained by algorithm in [31] (centered column), and by our proposal (right column).

Discussion
Many RDH-CE algorithms attempt to increase hiding rate and image contrast simultaneously. On the other hand, the proposed approach attempts to increase the hiding rate and decrease pixel modification (distortion). Afterward, contrast increment is indirectly achieved. The result is that we conceal part of the information at each iteration while delaying the quality drop; namely, we can embed more information with less distortion to the image. To prove the previous statement, Tables 4-8 show that for a similar hiding rate, Figure 18. Zoomed parts of some original images (left column), enhanced images obtained by algorithm in [31] (centered column), and by our proposal (right column).

Discussion
Many RDH-CE algorithms attempt to increase hiding rate and image contrast simultaneously. On the other hand, the proposed approach attempts to increase the hiding rate and decrease pixel modification (distortion). Afterward, contrast increment is indirectly achieved. The result is that we conceal part of the information at each iteration while delaying the quality drop; namely, we can embed more information with less distortion to the image. To prove the previous statement, Tables 4-8 show that for a similar hiding rate, our enhanced images are less distorted. Therefore, the metrics RCE, REE, and RMBE indicate less contrast, and SSIM and PSNR indicate more quality than other published works. It seems that lower quantitative contrast is a disadvantage, but we expose three supportive arguments. Firstly, contrast metrics and visual results show that contrast is achieved. Secondly, if contrast is not enough for a specific payload, we can embed additional filling information. Finally, visual results in Figure 18 show that unseen elements of the original image are revealed better in the enhanced image than other approaches. Furthermore, PSNR less than 30 does not indicate that the image is arbitrarily distorted because contrast metrics show a contrast increment, and SSIM values demonstrate the conservation of the structure of the image.
Our visual results in Figures 16-18 show that enhanced images have more noise in regions that were plane. Therefore, we generally have the worst evaluation in the nonreferenced quality metric BRISQUE because it measures the noise increment as a negative feature. However, this noise is not added by the algorithm but is part of the original image. Furthermore, we can indicate two advantages of the proposal. Firstly, the proposed method not just increases noise (Figure 16h) but also emphasizes textures ( Figure 17d) and reveals unseen details (Figure 17d,h) better compared with previous approaches. Secondly, visual results in Figures 16-18 show that contrast is increased globally in [35] and locally in our scheme, and hence, both results can be complementary. Therefore, the present algorithm is a novel approach to contrast images in the field of RDH-CE and can be appropriate for applications that need local contrast with an increment of details.
The parameter that most affects performance is the number of blocks defined by values F and C. If we select fewer blocks, optimization runs fewer times, and processing is faster. Additionally, the distortion decreases, but the maximum hiding rate may be reached prematurely, as shown in Figure 9. On the contrary, more blocks cause the optimization process to run more times; nevertheless, better image quality is achieved, and higher payloads can be embedded. In future work, a better optimization process will be designed to decrease processing time.

Conclusions
In this paper, we have proposed a novel reversible data-hiding scheme with image contrast enhancement applied to digital images. The proposed method improves the conventional histogram shifting techniques, considering several novel criteria focused on contrast enhancement and optimization of multirange selection and a multilevel embedding to outperform the quality and capacity performance obtained by the current state-of-the-art reported methods. Experimental results reveal that our method enhances the contrast of the images differently, obtaining a sharp definition of edges, contours, and textures without damaging the luminance in dark and bright areas, and at the same time allowing high hiding rates, from 0.1 up to 2 bit per pixel. Moreover, the visual quality of the images is guaranteed by the proposed algorithm, as shown in the experimentation conducted by metrics to measure the contrast increment such as REE, RMBE, RCE, and the visual distortion using the nonreferenced metric BRISQUE as well as the reference metrics PSNR and SSIM. This proposal is suitable for applications where local contrast enhancement, high payload, and reversibility should be ensured, such as medical imaging and military imagery, among others.