Skip to Content
CryptographyCryptography
  • Article
  • Open Access

30 December 2024

Reversible Data Hiding in Absolute Moment Block Truncation Codes via Arithmetical and Logical Differential Coding

,
,
and
1
Information and Communication Security Research Center, Feng Chia University, Taichung 40724, Taiwan
2
Department of Information Engineering and Computer Science, Feng Chia University, Taichung 40724, Taiwan
*
Authors to whom correspondence should be addressed.

Abstract

To reduce bandwidth usage in communications, absolute moment block truncation coding is employed to compress cover images. Confidential data are embedded into compressed images using reversible data-hiding technology for purposes such as image management, annotation, or authentication. As data size increases, enhancing embedding capacity becomes essential to accommodate larger volumes of secret data without compromising image quality or reversibility. Instead of using conventional absolute moment block truncation coding to encode each image block, this work proposes an effective reversible data-hiding scheme that enhances the embedding results by utilizing the traditional set of values: a bitmap, a high value, and a low value. In addition to the traditional set of values, a value is calculated using arithmetical differential coding and may be used for embedding. A process involving joint neighborhood coding and logical differential coding is applied to conceal the secret data in two of the three value tables, depending on the embedding capacity evaluation. An indicator is recorded to specify which two values are involved in the embedding process. The embedded secret data can be correctly extracted using a corresponding two-stage extraction process based on the indicator. To defeat the state-of-the-art scheme, bitmaps are also used as carriers in our scheme yet are compacted even more with Huffman coding. To reconstruct the original image, the low and high values of each block are reconstructed after data extraction. Experimental results show that our proposed scheme typically achieves an embedding rate exceeding 30%, surpassing the latest research by more than 2%. Our scheme reaches outstanding embedding rates while allowing the image to be perfectly restored to its original absolute moment block truncation coding form.

1. Introduction

With the rapid advancements in information technology, vast numbers of digital images are generated and disseminated daily across the Internet. Two key challenges that must be addressed are ensuring the security of confidential data transmitted with images and optimizing image transmission speed under limited bandwidth conditions. Data-hiding (DH) techniques [1,2,3,4,5,6,7] have been developed to tackle these issues. By embedding data within images using schemes like steganography, senders can safeguard the transmitted information, protecting it from unauthorized access or interception. The embedded data remain imperceptible to human observation and can only be retrieved using specific tools or schemes. These techniques enhance security since the concealed information is inaccessible even if intercepted during transmission.
Effective data compression is also critical to reducing file sizes and lowering transmission costs. However, integrating DH with compression poses a notable challenge: balancing the embedding capacity (EC) of compressed data with the visual quality of the resulting images. The increasing volume and diversity of transmitted data drive the need for innovative and efficient compression algorithms. Among the widely adopted schemes are vector quantization (VQ) [8,9], Joint Photographic Experts Group (JPEG) compression [10,11], block truncation coding (BTC) [12,13,14], and absolute moment block truncation coding (AMBTC) [15].
Proposed in 1984 by Lema and Mitchell [15], AMBTC is an efficient image compression scheme that offers a high compression rate while maintaining adequate image quality. Building on these strengths, researchers have developed new DH schemes based on AMBTC to enable secure and efficient data transmission [16,17,18,19,20,21,22,23]. In 2015, Ou et al. [16] introduced a DH scheme that concealed confidential data in the quantized values of AMBTC blocks. Their scheme leveraged the observation that smooth blocks exhibit similar quantized values, while complex blocks show more variability. Secret data were embedded in the bitmaps of smooth blocks and within the quantized values of complex blocks, one bit at a time. In 2016, Huang et al. [18] enhanced this scheme by developing a hybrid AMBTC DH scheme that modified the difference between two quantized values in a block. This innovation improved the EC and minimized the impact on image visual quality, outperforming Ou et al.’s technique. Kumar et al. [20] further advanced this research by combining pixel-value difference (PVD) [24] and Hamming distance techniques to classify blocks into smooth, low-complexity, and high-complexity categories. Different numbers of secret bits were embedded based on the block type, and the PVD technique increased the embedding capacity in high-complex blocks. In 2020, Horng et al. [21] proposed a DH scheme that used quotient value differencing (QVD) and least significant bit (LSB) substitution techniques to embed more secret bits in AMBTC compressed images. By rearranging the order of two quantized values and substituting the bitmap of smooth blocks with secret bits, their scheme achieved a higher EC. Chang et al. [19] introduced an efficient reversible data-hiding (RDH) scheme for AMBTC compressed images in 2018. They concatenated the quantized values of all blocks into high and low value tables, embedding confidential data using joint neighborhood coding (JNC) [22] and XOR operations. In 2024, Liu et al. [23] used side matching (SM) for bitmaps to further increase the embedding capacity.
In this study, we propose an improved RDH scheme based on AMBTC that delivers higher embedding capacity. Our scheme not only retains the original AMBTC block structure (a bitmap, a high value, and a low value) but also derives a difference value. Three value tables are formed, but only two of these tables are selected for data embedding. The combination of tables is chosen based on the best embedding capacity achieved. By using JNC and XOR operations, confidential data are sequentially embedded into two of these three value tables. This scheme increases the bit size by 1 or 2 bits to indicate which tables are used, but results in a significant increase in embedding capacity. It ensures the accurate reconstruction of the embedded data, bitmaps, the high value table, and the low value table. These value tables can subsequently be used to reconstruct the AMBTC uncompressed image. Although the scheme proposed by Liu et al. [23] achieves an excellent embedding capacity and guarantees AMBTC reversibility, there is still room for further improvement in embedding capacity. This paper presents an enhanced RDH scheme based on AMBTC by exploiting reference pixels as embeddable pixels and altering the two quantized value tables to accommodate more confidential data. Additionally, the SM technique is applied to the bitmaps, and Huffman coding is used to compress the bitmaps and free up space for embedding secret bits. The key contributions of this scheme are as follows:
  • We use a difference table to create more embedding space for the value table and apply multi-layer processing to make room for the bitmap. Compared with the state-of-the-art scheme, our proposed scheme achieves a higher embedding capacity.
  • This is a scheme that can reverse the AMBTC compressed file losslessly.
  • Our proposed scheme demonstrates good performance for a wide range of images, including but not limited to grayscale, color, standard, complex, and various sizes, reflecting the adaptability of our proposed scheme.
The remainder of this paper is structured as follows: Section 2 reviews the related work. Section 3 outlines the proposed scheme, while Section 4 presents experimental results. Finally, Section 5 concludes the study.

3. Proposed Scheme

The sender first compresses the original AMBTC image and embeds the secret data into the compressed file, producing a stego compressed file. Upon receiving the stego compressed file, the receiver can extract the secret data and reconstruct the AMBTC image reversibly. Figure 4 illustrates the flow of the proposed scheme.
Figure 4. Flow of our proposed scheme.

3.1. AMBTC Compression Phase

We use the AMBTC compression algorithm described in Section 2.1 of Related Work. For each block, the algorithm generates an 8-bit high value, an 8-bit low value, and a 16-bit bitmap. As an additional preprocessing step, shown in Equation (5), we calculate the difference between the high value and the low value using arithmetical differential coding. Here, h denotes the high value, l denotes the low value, and d denotes the difference. After processing all the blocks, we obtain a high table, a low table, a difference table, and a bitmap table.
d = h l .

3.2. Data Embedding Phase

The proposed scheme embeds data in two stages. The high table, the low table, and the difference table are considered as value tables. For a value table, logical differential coding is used to embed data. The combination of two value tables is selected based on the largest embedding capacity obtained. Bitmap embeddings are mainly based on the side match algorithm. After two layers of SM embeddings, a third layer of embedding is performed by applying Huffman coding compression to unprocessed bits in the bitmap to create space for embedding data.
(1)
Embed Data into Value Tables
Algorithm 1 describes the process of embedding data into the value table in detail. First, the JNC algorithm is used to conceal data into the high table H T , the low table L T , and the difference table D T , respectively. The first row, the first column, and the last column of a value table are reserved as references and their original values are maintained. For the remaining positions, the XOR value e i j of the current value and the reference value, selected based on a 2-bit secret, is calculated. Due to the inherent properties of the XOR operation, boundary pixels are immune to both overflow and underflow issues. Depending on the magnitude of e i j , E i j is used as a category indicator and the secret embedding capacity E C i j is then determined. After traversing all positions, the embedding capacities of the three tables are obtained. There are three possible combinations of the value tables: H T and L T , H T and D T , and L T and D T . To distinguish the three combinations, the table indicators 00, 01, and 1 are used, respectively. The table combination with the largest embedding capacity is selected for data storage. Finally, the value table encoding stream V T E S is generated and output according to the JNC algorithm.
Algorithm 1 Embed Data into Value Tables
InputHigh table H T , low table L T , difference table D T , secret data S .
OutputValue table encoding stream V T E S .
Step 1 V T E S = [ ] ;
E C H = 0 ;
E C L = 0 ;
E C D = 0 ;
k = 0 ;
[ r o w ,   c o l ] = s i z e o f ( H T ) ;
Step 2for  i = 2: r o w
for  j = 2: c o l 1
   r p H i j = g e t _ r e f e r e n c e _ p i x e l ( H T , i , j )
   p H i j = H T ( i , j ) ;
   e H i j = p H i j r p H i j ;
   [ E H i j ,   b i n e H i j ,   E C H ] = p r o c e s s _ e n c o d i n g ( e H i j ,   E C H ) ;
   r p L i j = g e t _ e n c o d e d _ p i x e l ( L T , i , j )
   p L i j = L T ( i , j ) ;
   e L i j = p L i j r p L i j ;
   [ E L i j ,   b i n e L i j ,   E C L ] = p r o c e s s _ e n c o d i n g ( e L i j ,   E C L ) ;
    r p D i j = g e t _ r e f e r e n c e _ p i x e l ( D T , i , j )
   p D i j = D T ( i , j ) ;
   e D i j = p D i j r p D i j ;
   [ E D i j ,   b i n e D i j ,   E C D ] = p r o c e s s _ e n c o d i n g ( e D i j ,   E C D ) ;
 end for
end for
function  r p = g e t _ r e f e r e n c e _ p i x e l ( t a b l e ,   i ,   j )
switch  S ( k : k + 1 )
   case ‘00’
    r p = t a b l e ( i 1 ,   j 1 ) ;
   case ‘01’
    r p = t a b l e ( i 1 ,   j ) ;
   case ‘10’
    r p = t a b l e ( i 1 ,   j + 1 ) ;
   case ‘11’
    r p = t a b l e ( i ,   j 1 ) ;
end switch
   k = k + 2 ;
end function
function  [ E i j ,   b i n e i j ,   E C ] = p r o c e s s _ e n c o d i n g ( e i j ,   E C )
if  e i j 7
   E i j = ‘00’;
   b i n e i j = d e c 2 b i n ( e i j ) ;
   E C i j = 5 ;
elseif  e i j 15
   E i j = ‘01’;
   b i n e i j = d e c 2 b i n ( e i j 8 ) ;
   E C i j = 5 ;
elseif  e i j 31
   E i j = ‘10’;
   b i n e i j = d e c 2 b i n ( e i j 16 ) ;
   E C i j = 4 ;
else
    E i j = ‘11’;
   b i n e i j = d e c 2 b i n ( e i j ) ;
   E C i j = 0 ;
end if
   E C = E C + E C i j ;
end function
Step 3 E C H L = E C H + E C L ;
E C H D = E C H + E C D ;
E C L D = E C L + E C D ;
[ E C m a x ,   i n d e x ] = m a x ( [ E C H L ,   E C H D ,   E C L D ] ) ;
switch index
case 1
    i n d i c a t o r = ’00’;
   V T E S = v a l u e _ t a b l e _ e n c o d i n g ( H T , L T ) ;
case 2
    i n d i c a t o r = ’01’;
   V T E S = v a l u e _ t a b l e _ e n c o d i n g ( H T , D T ) ;
case 3
    i n d i c a t o r = ’1’;
   V T E S = v a l u e _ t a b l e _ e n c o d i n g ( L T , D T ) ;
end switch
function  V T E S = v a l u e _ t a b l e _ e n c o d i n g ( t a b l e 1 , t a b l e 2 )
   V T E S = V T E S | | i n d i c a t o r ;
for  i = 1: r o w
   for  j = 1: c o l
    if  i == 1 or  j == 1
     V T E S = V T E S | | d e c 2 b i n t a b l e 1 i , j ;
     V T E S = V T E S | | d e c 2 b i n t a b l e 2 i , j ;
    else
     if E C t a b l e 1 i j   0
       V T E S = V T E S | | E t a b l e 1 i j | | e t a b l e 1 i j | | S ( k : k + E C t a b l e 1 i j 1 )
      k = k + E C t a b l e 1 i j ;
     end if
     if E C t a b l e 2 i j   0
       V T E S = V T E S | | E t a b l e 2 i j | | e t a b l e 2 i j | | S ( k : k + E C t a b l e 2 i j 1 )
      k = k + E C t a b l e 2 i j ;
     end if
    end if
   end for
end for
end function
Step 4Output value table encoding stream V T E S .
(2)
Embed Data into Bitmap
Algorithm 2 describes the process of embedding secret data into a bitmap B M . The bitmap is divided into 4 × 4 blocks, and three layers of embedding processes are applied to each block. For the first layer of embedding, side match prediction is used to determine the 7 side bits of the current block based on the surrounding blocks. Blocks at the first row and first column are treated as references which are not processed in this layer. For each block, the 7 bits are checked to determine if they are all 0 or all 1. If so, embedding is not possible, and the bit values can be naturally inferred without requiring an indicator. Otherwise, side bits from adjacent blocks are used to predict reference values. All possible bit combinations of the 7 side bits are then generated, and their Euclidean distances from the reference bits are calculated. If the distance of the original 7 side bits is the closest one among all combinations, the block can be embedded. A ‘1’ is marked as an indicator, and secret data bits are embedded. If the distance of the original bits is not the closest one, a ‘0’ is used to indicate that bits are not embeddable. The second layer of embedding is similar to the first one except it focuses on side matching within the block. Here, the 7 side bits within the block are used to predict the 5 bits selected for the second layer embedding. Same as the first layer embedding, the bit combinations are listed and Euclidean distances are calculated. Secret data are embedded in the same manner as in the first layer. As for the third layer of embedding, the 2 × 2 sub-block at the lower-right corner of the 4 × 4 block is used. These 4 bits, which has not yet been processed, are treated as symbols. After counting the occurrences of these symbols across all blocks, Huffman coding is applied to compress the data. The freed space can then be used to embed additional secret data. Finally, the bitmap encoding stream B M E S is generated as the output.
Algorithm 2 Embed Data into Bitmap
Input Bitmap B M , secret data S .
OutputBitmap encoding stream B M E S .
Step 1 B M E S = [ ] ;
i n d i c a t o r = [ ] ;
E C B M = 0 ;
s i z e b l o c k = 4 ;
Step 2for  i = s i z e b l o c k + 1: r o w : s i z e b l o c k
for  j = s i z e b l o c k +1: c o l : s i z e b l o c k
   b ( 1 ) = B M i , j ;
   b ( 2 ) = B M i , j + 1 ;
   b ( 3 ) = B M i , j + 2 ;
   b ( 4 ) = B M i , j + 3 ;
   b ( 5 ) = B M i + 1 , j ;
   b ( 6 ) = B M i + 2 , j ;
   b ( 7 ) = B M i + 3 , j ;
   if  ~ ( a l l b = = 0   | |   a l l ( b = = 1 ) )
    r b ( 1 ) = c e i l ( ( B M i 1 , j + B M i , j 1 ) / 2 )   ;
    r b ( 2 ) = B M i 1 , j + 1 ;
    r b ( 3 ) = B M i 1 , j + 2 ;
    r b ( 4 ) = B M i 1 , j + 3 ;
    r b ( 5 ) = B M i + 1 , j 1 ;
    r b ( 6 ) = B M i + 2 , j 1 ;
    r b ( 7 ) = B M i + 3 , j 1 ;
    p e r m u t a t i o n s = u n i q u e ( p e r m b ) ;
    [ ~ ,   i n d e x ] = i s m e m b e r ( b , p e r m u t a t i o n s ) ;
    for  l = 1: s i z e ( p e r m u t a t i o n s , 2 )
     D l = 0 ;
     for  m = 1:7
      D l = D l + ( r b m p e r m u t a t i o n s m , l ) 2 ;
    end for
    end for
    D s o r t e d = s o r t ( D ) ;
   if  i n d e x s o r t e d = 1
     [ b e m b e d ] = d a t a _ e m b e d d i n g ( b , S ) ;
     B M E S = [ B M E S , b e m b e d ] ;
     E C B M = E C B M + f l o o r ( l o g 2 ( s i z e ( p e r m u t a t i o n s , 2 ) ) ) ;
     i n d i c a t o r = [ i n d i c a t o r , 1 ] ;
    else
     i n d i c a t o r = [ i n d i c a t o r , 0 ] ;
    end
   end if
end for
end for
Step 3for  i = s i z e b l o c k : r o w : s i z e b l o c k
for  j = s i z e b l o c k : c o l : s i z e b l o c k
   b 2 ( 1 ) = B M i + 1 , j + 1 ;
   b 2 ( 2 ) = B M i + 1 , j + 2 ;
   b 2 ( 3 ) = B M i + 1 , j + 3 ;
   b 2 ( 4 ) = B M i + 2 , j + 1 ;
   b 2 ( 5 ) = B M i + 3 , j + 1 ;
   if  ~ ( a l l b 2 = = 0   | |   a l l ( b 2 = = 1 ) )
    r b 2 ( 1 ) = c e i l ( ( B M i , j + 1 + B M i + 1 , j ) / 2 )   ;
    r b 2 ( 2 ) = B M i , j + 2 ;
    r b 2 ( 3 ) = B M i , j + 3 ;
    r b 2 ( 4 ) = B M i + 2 , j ;
    r b 2 ( 5 ) = B M i + 3 , j ;
    p e r m u t a t i o n s 2 = u n i q u e ( p e r m b 2 ) ;
    [ ~ ,   i n d e x 2 ] = i s m e m b e r ( b 2 , p e r m u t a t i o n s 2 ) ;
    for  l = 1: s i z e ( p e r m u t a t i o n s 2,2 )
     D 2 l = 0 ;
     for  m = 1:7
      D 2 l = D 2 l + ( r b 2 m p e r m u t a t i o n s 2 m , l ) ^ 2 ;
     end for
    end for
    D 2 s o r t e d = s o r t ( D 2 ) ;
    if  i n d e x 2 s o r t e d = 1
     b 2 e m b e d = d a t a _ e m b e d d i n g ( b 2 , S ) ;
     B M E S = [ B M E S , b 2 e m b e d ] ;
     E C B M = E C B M + f l o o r ( l o g 2 ( s i z e ( p e r m u t a t i o n s 2,2 ) ) ) ;
     i n d i c a t o r = [ i n d i c a t o r , 1 ] ;
    else
     i n d i c a t o r = [ i n d i c a t o r , 0 ] ;
    end
   end if
end for
end for
Step 4 s y m b o l s = [ ] ;
for  i = s i z e b l o c k : r o w : s i z e b l o c k
for  j = s i z e b l o c k : c o l : s i z e b l o c k
   b 3 ( 1 ) = B M i + 2 , j + 2 ;
   b 3 ( 2 ) = B M i + 2 , j + 3 ;
   b 3 ( 3 ) = B M i + 3 , j + 2 ;
   b 3 ( 4 ) = B M i + 3 , j + 3 ;
   s y m b o l = [ b 3 1 ,   b 3 2 ,   b 3 3 ,   b 3 4 ] ;
   s y m b o l s = [ s y m b o l s , s y m b o l ] ;
  end for
end for
[ u n i q u e _ s y m b o l s ,   ~ ,   i d x ] = u n i q u e ( s y m b o l s ) ;
f r e q u e n c i e s = a c c u m a r r a y ( i d x ,   1 ) ;
p r o b a b i l i t i e s = f r e q u e n c i e s   /   s u m ( f r e q u e n c i e s ) ;
[ d i c t ] = h u f f m a n d i c t ( u n i q u e _ s y m b o l s ,   p r o b a b i l i t i e s ) ;
e n c o d e = [ h u f f m a n e n c o ( s y m b o l s ,   d i c t ) ;
E C B M = E C B M + ( l e n g t h ( s y m b o l s ) 4 l e n g t h ( e n c o d e ) ) ;
B M E S = [ B M E S , u n i q u e _ s y m b o l s , f r e q u e n c i e s , e n c o d e , S ( k : k + E C B M ) ] ;
Step 5Output bitmap encoding stream B M E S .

3.3. Data Extraction and Image Reconstruction

The data extraction and image reconstruction phase are also carried out in two stages. For value tables, we first identify the two stored value tables based on the table indicator. These tables are then decoded not only to restore the original high and low tables but also to extract the secret data. For bitmaps, the first two layers employ side-matching to restore the image and extract the secrets. The third layer extraction uses Huffman decoding to reconstruct the bitmap and retrieve the secret data.
(1)
Reconstruct Value Tables and Extract Data
Algorithm 3 describes the process of reconstructing the value tables and extracting data. The input is the value table encoding stream V T E S . First, the prefix code is read to obtain the table indicator. The subsequent V T E S is then divided into two parts: value table V T 1 and V T 2 . The first row, the first column and the last column of a value table are used for references. Other than references occupying 8 bits each, the other positions containing embedded data occupy 12 bits each. The value tables V T 1 and V T 2 are processed separately but following the same processing steps: select a reference position based on the 2-bit secret data as in the JNC method; then reconstruct the original value using logical differential coding and extract the secret data; use the table indicator to determine which tables are reconstructed. If the table indicator is ‘00’, V T 1 represents the high table H T and V T 2 represents the low table L T . If the table indicator is ‘01’, V T 1 represents the high table H T and V T 2 represents the difference table D T . If the table indicator is ‘1’, V T 1 represents the low table L T and V T 2 represents the difference table D T . Finally, H T and L T are calculated and reconstructed using arithmetical differential coding.
Algorithm 3 Reconstruct Value Tables and Extract Data
InputValue table encoding stream V T E S .
OutputHigh table H T , low table L T , secret data S .
Step 1 S = [ ] ;
l = 1 ;
i n d i c a t o r = V T E S ( l ) ;
l = l + 1 ;
if  i n d i c a t o r == ‘0’
i n d i c a t o r = V T E S ( l : l + 1 ) ;
l = l + 1 ;
end if
V T 1 = V T E S ( l : l + r o w + c o l 1 8 + r o w 1 c o l 1 12 ;
l = l + r o w + c o l 1 8 + r o w 1 c o l 1 12 ;
V T 2 = V T E S ( l : l + r o w + c o l 1 8 + r o w 1 c o l 1 12 ;
l = l + r o w + c o l 1 8 + r o w 1 c o l 1 12 ;
Step 2for  i = 2: r o w
for  j = 2: c o l -1
   t a b l e B i t s 1 = V T 1 i , j ;
   [ r p 1 i j , S ] = g e t _ r e f e r e n c e _ p i x e l ( t a b l e B i t s 1 ) ;
   [ e 1 i j , S ] = p r o c e s s _ d e c o d i n g ( t a b l e B i t s 1 ) ;
   p 1 i j = e 1 i j r p 1 i j ;
   t a b l e B i t s 2 = V T 2 i , j ;
   [ r p 2 i j , S ] = g e t _ r e f e r e n c e _ p i x e l ( t a b l e B i t s 2 ) ;
   [ e 2 i j , S ] = p r o c e s s _ d e c o d i n g ( t a b l e B i t s 2 ) ;
   p 2 i j = e 2 i j r p 2 i j ;
end for
end for
function  [ r p , S ] = g e t _ r e f e r e n c e _ p i x e l ( t a b l e B i t s )
switch  t a b l e B i t s ( 1 : 2 )
   case ‘00’
    r p = t a b l e ( i 1 ,   j 1 ) ;
   case ‘01’
    r p = t a b l e ( i 1 ,   j ) ;
   case ‘10’
    r p = t a b l e ( i 1 ,   j + 1 ) ;
   case ‘11’
    r p = t a b l e ( i ,   j 1 ) ;
   end switch
   S = [ S , t a b l e B i t s 1 : 2 ] ;
end function
function  [ e i j , S ] = p r o c e s s _ d e c o d i n g ( t a b l e B i t s )
E i j = t a b l e B i t s ( 3,4 ) ;
if  E i j = ‘00’
   b i n e i j = t a b l e B i t s ( 5 : 7 ) ;
   e i j = b i n 2 d e c ( b i n e i j ) ;
   S = [ S , t a b l e B i t s ( 8,12 ) ] ;
elseif  E i j = ‘01’
   b i n e i j = t a b l e B i t s ( 5 : 7 ) ;
   e i j = 8 + b i n 2 d e c ( b i n e i j ) ;
   S = [ S , t a b l e B i t s ( 8,12 ) ] ;
elseif  E i j = ‘10’
   b i n e i j = t a b l e B i t s ( 5 : 8 ) ;
   e i j = 16 + b i n 2 d e c ( b i n e i j ) ;
   S = [ S , t a b l e B i t s ( 9,12 ) ] ;
elseif E i j = ‘11’
    b i n e i j = t a b l e B i t s ( 5 : 12 ) ;
   e i j = b i n 2 d e c ( b i n e i j ) ;
end if
end function
Step 3if  i n d i c a t o r == ‘00’
H T = V T 1 ;
L T = V T 2 ;
else if  i n d i c a t o r == ‘01’
H T = V T 1 ;
L T = V T 1 V T 2 ;
else if  i n d i c a t o r == ‘1’
H T = V T 1 + V T 2 ;
L T = V T 1 ;
end if
Step 4Output high table H T , low table L T , secret data S .
(2)
Reconstruct Bitmap and Extract Data
Algorithm 4 describes the process of reconstructing a bitmap and extracting data. The input is the bitmap encoding stream B M E S , and the preset block size is 4. Unlike the embedding stage, we must reconstruct the third layer first. To begin, symbols and their frequencies are extracted from B M E S . Next, the Huffman tree is calculated and constructed, followed by decoding the Huffman encoding stream. Once decoding is completed, the symbols are replaced in the bitmap, and part of the secret data is extracted. The reconstruction then proceeds to the first layer. For each block, the 7 bits inside the block are checked. If all bits are 0 or all are 1, it indicates no embedding. Otherwise, a 1-bit embedding indicator is read. If the indicator is ‘1’, it signifies embedding. All possible combinations of the 7 bits are then listed and their Euclidean distances to the corresponding bits derived from adjacent blocks are calculated. The bit combination with the shortest distance is identified as the original 7 side bits from the first layer of embedding, and its binary index represents the secret data. If the indicator is ‘0’, it indicates no embedding, meaning the 7 bits remain unchanged. The second layer is processed similarly to the first layer. First, it is determined whether all bits are 0 or all are 1. If not, the indicator is read, and the shortest Euclidean distance is used for reconstruction and secret data extraction. After processing all three layers, the bitmap is fully reconstructed, and all secret data are successfully extracted.
Algorithm 4 Reconstruct Bitmap and Extract Data
Input Bitmap encoding stream B M E S .
OutputBitmap B M , secret data S .
Step 1 s i z e b l o c k = 4 ;
s y m b o l s = [ ] ;
p r o b a b i l i t i e s = f r e q u e n c i e s   /   s u m ( f r e q u e n c i e s ) ;
[ d i c t ] = h u f f m a n d i c t ( u n i q u e _ s y m b o l s ,   p r o b a b i l i t i e s ) ;
d e c o d e = [ h u f f m a n d e c o ( s y m b o l s ,   d i c t ) ;
E C B M = E C B M + ( l e n g t h ( s y m b o l s ) 4 l e n g t h ( e n c o d e ) ) ;
B M E S = [ B M E S , e n c o d e , S ( k : k + E C B M ) ] ;
for  i = s i z e b l o c k : r o w : s i z e b l o c k
for  j = s i z e b l o c k : c o l : s i z e b l o c k
   s y m b o l = s y m b o l s ( i , j ) ;
   B M i + 2 , j + 2 = s y m b o l ( 1 ) ;
   B M i + 2 , j + 3 = s y m b o l ( 2 ) ;
   B M i + 3 , j + 2 = s y m b o l ( 3 ) ;
   B M i + 3 , j + 3 = s y m b o l ( 4 ) ;
end for
end for
S = [ S , B M E S ( k : k + E C B M ) ] ;
Step 2for  i = s i z e b l o c k +1: r o w : s i z e b l o c k
for  j = s i z e b l o c k +1: c o l : s i z e b l o c k
   b ( 1 ) = B M i , j ;
   b ( 2 ) = B M i , j + 1 ;
   b ( 3 ) = B M i , j + 2 ;
   b ( 4 ) = B M i , j + 3 ;
   b ( 5 ) = B M i + 1 , j ;
   b ( 6 ) = B M i + 2 , j ;
   b ( 7 ) = B M i + 3 , j ;
   if  ~ ( a l l b = = 0   | |   a l l ( b = = 1 ) )
    r b ( 1 ) = c e i l ( ( B M i 1 , j + B M i , j 1 ) / 2 )   ;
    r b ( 2 ) = B M i 1 , j + 1 ;
    r b ( 3 ) = B M i 1 , j + 2 ;
    r b ( 4 ) = B M i 1 , j + 3 ;
    r b ( 5 ) = B M i + 1 , j 1 ;
    r b ( 6 ) = B M i + 2 , j 1 ;
    r b ( 7 ) = B M i + 3 , j 1 ;
    p e r m u t a t i o n s = u n i q u e ( p e r m b ) ;
    [ ~ ,   i n d e x ] = i s m e m b e r ( b , p e r m u t a t i o n s ) ;
    for  l = 1: s i z e ( p e r m u t a t i o n s , 2 )
     D l = 0 ;
     for  m = 1:7
      D l = D l + ( r b m p e r m u t a t i o n s m , l ) ^ 2 ;
     end for
    end for
    D s o r t e d = s o r t ( D ) ;
    if  i n d i c a t o r = 1
     S = d a t a _ e x t r a c t i o n ( b 1 , S ) ;
     b 1 r e c o n s t r u c t e d = p e r m u t a t i o n s ( i n d e x 1 s o r t e d ) ;
     B M i , j = b 1 r e c o n s t r u c t e d ( 1 ) ;
     B M i , j + 1 = b 1 r e c o n s t r u c t e d ( 2 ) ;
     B M i , j + 2 = b 1 r e c o n s t r u c t e d ( 3 ) ;
     B M i , j + 3 = b 1 r e c o n s t r u c t e d ( 4 ) ;
     B M i + 1 , j = b 1 r e c o n s t r u c t e d ( 5 ) ;
     B M i + 2 , j = b 1 r e c o n s t r u c t e d ( 6 ) ;
     B M i + 3 , j = b 1 r e c o n s t r u c t e d ( 7 ) ;
    end
   end if
end for
end for
Step 3for  i = s i z e b l o c k : r o w : s i z e b l o c k
for  j = s i z e b l o c k : c o l : s i z e b l o c k
   b 2 ( 1 ) = B M i + 1 , j + 1 ;
   b 2 ( 2 ) = B M i + 1 , j + 2 ;
   b 2 ( 3 ) = B M i + 1 , j + 3 ;
   b 2 ( 4 ) = B M i + 2 , j + 1 ;
   b 2 ( 5 ) = B M i + 3 , j + 1 ;
   if  ~ ( a l l b 2 = = 0   | |   a l l ( b 2 = = 1 ) )
    r b 2 ( 1 ) = c e i l ( ( B M i , j + 1 + B M i + 1 , j ) / 2 )   ;
    r b 2 ( 2 ) = B M i , j + 2 ;
    r b 2 ( 3 ) = B M i , j + 3 ;
    r b 2 ( 4 ) = B M i + 2 , j ;
    r b 2 ( 5 ) = B M i + 3 , j ;
    p e r m u t a t i o n s 2 = u n i q u e ( p e r m b 2 ) ;
    [ ~ ,   i n d e x 2 ] = i s m e m b e r ( b 2 , p e r m u t a t i o n s 2 ) ;
    for  l = 1: s i z e ( p e r m u t a t i o n s 2,2 )
     D 2 l = 0 ;
     for  m = 1:7
      D 2 l = D 2 l + ( r b 2 m p e r m u t a t i o n s 2 m , l ) ^ 2 ;
     end for
    end for
    D 2 s o r t e d = s o r t ( D 2 ) ;
    if  i n d i c a t o r = 1
     S = d a t a _ e x t r a c t i o n ( b 2 , S ) ;
     b 2 r e c o n s t r u c t e d = p e r m u t a t i o n s ( i n d e x 2 s o r t e d ) ;
     B M i + 1 , j + 1 = b 2 r e c o n s t r u c t e d ( 1 ) ;
     B M i + 1 , j + 2 = b 2 r e c o n s t r u c t e d ( 2 ) ;
     B M i + 1 , j + 3 = b 2 r e c o n s t r u c t e d ( 3 ) ;
     B M i + 2 , j + 1 = b 2 r e c o n s t r u c t e d ( 4 ) ;
     B M i + 3 , j + 1 = b 2 r e c o n s t r u c t e d ( 5 ) ;
    end
   end if
end for
end for
Step 4Bitmap B M , secret data S .
After the two stages, we obtain the high table, low table, and bitmap, and reconstruct the image using the AMBTC algorithm. By combining the secret data from both stages, the complete secret data can be retrieved.

4. Experimental Results

In this section, we present the experimental analysis and compare our results with the most advanced AMBTC data hiding scheme. The experiments were conducted on a Windows 11 computer equipped with a 3.20 GHz AMD Ryzen 7 CPU (AMD, located in Santa Clara, CA, USA) and 16 GB of RAM, using MATLAB 2024a. Figure 5 illustrates the test images used in our scheme. Specifically, the first row represents standard grayscale images, the second row represents complex grayscale images, and the third row represents color images.
Figure 5. Test images: (ad) standard grayscale images; (eh) complex grayscale images; (il) color images.
The quality of a decompressed image is evaluated using the peak signal-to-noise ratio (PSNR), which quantifies the difference between the original image and the AMBTC decompressed image. The mean square error (MSE), which measures the average squared difference between corresponding pixel values in the original and decompressed images, is used in the calculation of PSNR. In Equations (6) and (7), I i j and I i j represent the corresponding pixel values of the original image and the decompressed image, respectively, while H and W denote the height and width of the images.
P S N R = 10 log 10 255 2 M S E ,
M S E = i = 1 H j = 1 W I i j I i j 2 H × W .
To evaluate the embedding capability, we use two indicators, as shown in Equations (8) and (9). Equation (8) represents the embedding rate (ER), which is calculated by dividing the embedding capacity (EC) by the file size (FS). Equation (9) represents the pure embedding capacity (PEC), which is the embedding capacity reduced by the difference between the file size and the original file size (OFS).
E R = E C F S ,
P E C = E C F S O F S .
Table 1 presents a performance comparison of our schemes applied to standard grayscale images. It can be observed that all the schemes are reversible for AMBTC compressed images, resulting in identical PSNR values. The ER of our proposed scheme exceeds 30%. Compared to the scheme proposed by Liu et al. [23] in 2024, our ER is approximately 2% higher, and the PEC is about 15,000 bits greater. Furthermore, it also outperforms other schemes and achieves the best ER and PEC among all.
Table 1. Performance comparison on standard grayscale images with other schemes.
Table 2 presents a performance comparison of our schemes on complex grayscale images. It can be observed that the PSNR is slightly lower for complex grayscale images. Due to the relatively low correlation within image blocks, the EC is also reduced, leading to lower ER and PEC compared to standard grayscale images. Nevertheless, our scheme still achieves the best results compared to other schemes. The image ‘Owl’ performs particularly well, with embedding rate reaching 28.88% and a PEC of 49,726.
Table 2. Performance comparison on complex grayscale images with other schemes.
Table 3 presents a performance comparison between our schemes and other schemes on color images. Since RGB images have three channels, their file size is typically about three times larger than that of grayscale images. It can be observed that our proposed scheme demonstrates superior embedding ability while maintaining an almost identical file size to other schemes. For the color image ‘Airplane’, the embedding rate reaches 32.87%, and the PEC achieves 233,726 bits. It represents a significant improvement over other schemes.
Table 3. Performance comparison on color images with other schemes.
We also evaluated the performance on different image sizes. Experiments were conducted on three sizes of the grayscale image ‘Airplane’: 256 × 256, 512 × 512, and 1024 × 1024. As shown in Table 4, the embedding performance of our proposed scheme is superior to other schemes across all three sizes, particularly for the 1024 × 1024 image, where the ER and PEC reach 40.00% and 491,892 bits, respectively.
Table 4. Performance comparison on the image ‘Airplane’ of different sizes with other schemes.
To demonstrate the necessity of calculating the difference table based on the value tables, we use the 512 × 512 grayscale image ‘Airplane’ as shown in Table 5. It can be observed that the embedding capacity of the difference table is higher. It suggests that our scheme can outperform the scheme which only uses the high and low tables. Since the embedding capacity of the difference table is the lowest among the three in some cases, we use an additional 2 bits for the table indicator to make sure the highest embedding capacity.
Table 5. Embedding capacity analysis of the value tables on the image ‘Airplane’.
Table 6 presents the time complexity of the proposed scheme at different stages. The time complexity for embedding data into a value table, as well as for reconstructing the value table and extracting data, follows a linear complexity, O ( n ) . In contrast, the time complexity for embedding data into a bitmap, as well as for reconstructing the bitmap and extracting data, is O ( n × 7 × 7 ! ) , due to the need to enumerate all permutations of 7 bits in this stage of the process. This increased complexity arises as a trade-off for achieving a higher embedding capacity.
Table 6. Time complexity of the proposed scheme at different stages.

5. Conclusions

This paper proposes a reversible data hiding scheme for AMBTC compressed files. Based on the characteristics of AMBTC compressed files, we perform a two-stage processing of data hiding on the value tables and bitmaps. For the value tables, we introduce a difference table derived from the original high and low tables, which effectively enhances the embedding capacity. For the bitmaps, we further apply Huffman compression as the third layer of embedding building upon the original two-layer side match algorithm. The Huffman compression further frees up additional space for embedding secret data. Experimental results demonstrate that our proposed scheme achieves both higher embedding rates and better pure embedding capacities while maintaining the reversibility of AMBTC compressed files. In the future, we will further explore the carrier characteristics of AMBTC and investigate schemes to find further improvements.

Author Contributions

Conceptualization, C.-C.C. (Ching-Chun Chang), Y.L. and J.-C.L.; schemeology, C.-C.C. (Ching-Chun Chang), Y.L. and J.-C.L.; software, Y.L.; validation, Y.L.; writing—original draft preparation, Y.L. and J.-C.L.; writing—review and editing, C.-C.C. (Ching-Chun Chang), Y.L., J.-C.L. and C.-C.C. (Chin-Chen Chang). All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

Data are contained within the article.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Tian, J. Reversible data embedding using a difference expansion. IEEE Trans. Circuits Syst. Video Technol. 2003, 13, 890–896. [Google Scholar] [CrossRef] [Scilit]
  2. Alattar, A.M. Reversible watermark using the difference expansion of a generalized integer transform. IEEE Trans. Image Process. 2004, 13, 1147–1156. [Google Scholar] [CrossRef] [Scilit]
  3. Chan, C.K.; Cheng, L.M. Hiding data in images by simple LSB substitution. Pattern Recognit. 2004, 37, 469–474. [Google Scholar] [CrossRef] [Scilit]
  4. Ni, Z.; Shi, Y.Q.; Ansari, N.; Su, W. Reversible data hiding. IEEE Trans. Circuits Syst. Video Technol. 2006, 16, 354–362. [Google Scholar]
  5. Wu, H. Recent advances in reversible watermarking in an encrypted domain. In Advanced Security Solutions for Multimedia; IOP Publishing: Bristol, UK, 2021; pp. 4-1–4-17. [Google Scholar]
  6. Jiang, X.; Xie, Y.; Zhang, Y.; Ye, Y.; Xu, F.; Li, L.; Su, Y.; Chen, Z. Reversible Data Hiding in Encrypted Images Using Reservoir Computing Based Data Fusion Strategy. IEEE Trans. Circuits Syst. Video Technol. 2024. [Google Scholar] [CrossRef] [Scilit]
  7. Gao, G.; Yang, S.; Hu, X.; Xia, Z.; Shi, Y.Q. Reversible data hiding-based local contrast enhancement with nonuniform superpixel blocks for medical images. IEEE Trans. Circuits Syst. Video Technol. 2024. [Google Scholar] [CrossRef] [Scilit]
  8. Linde, Y.; Buzo, A.; Gray, R. An algorithm for vector quantizer design. IEEE Trans. Commun. 1980, 28, 84–95. [Google Scholar] [CrossRef] [Scilit]
  9. Chavan, P.P.; Sheela Rani, B.; Murugan, M.; Chavan, P. An image compression model via adaptive vector quantization: Hybrid optimization algorithm. Imaging Sci. J. 2020, 68, 259–277. [Google Scholar] [CrossRef] [Scilit]
  10. Perfilieva, I.; Hurtik, P. The F-transform preprocessing for JPEG strong compression of high-resolution images. Inf. Sci. 2021, 550, 221–238. [Google Scholar] [CrossRef] [Scilit]
  11. Hamano, G.; Imaizumi, S.; Kiya, H. Effects of jpeg compression on vision transformer image classification for encryption-then-compression images. Sensors 2023, 23, 3400. [Google Scholar] [CrossRef] [Scilit]
  12. Delp, E.; Mitchell, O. Image compression using block truncation coding. IEEE Trans. Commun. 1979, 27, 1335–1342. [Google Scholar] [CrossRef] [Scilit]
  13. Yang, C.N.; Chou, Y.C.; Chang, T.K.; Kim, C. An enhanced adaptive block truncation coding with edge quantization scheme. Appl. Sci. 2020, 10, 7340. [Google Scholar] [CrossRef] [Scilit]
  14. Lin, Y.; Lin, C.C.; Chang, C.C.; Chang, C.C. An IoT-Based Electronic Health Protection Mechanism With AMBTC Compressed Images. IEEE Internet Things J. 2024. [Google Scholar] [CrossRef] [Scilit]
  15. Lema, M.; Mitchell, O. Absolute moment block truncation coding and its application to color images. IEEE Trans. Commun. 1984, 32, 1148–1157. [Google Scholar] [CrossRef] [Scilit]
  16. Ou, D.; Sun, W. High payload image steganography with minimum distortion based on absolute moment block truncation coding. Multimed. Tools Appl. 2015, 74, 9117–9139. [Google Scholar] [CrossRef] [Scilit]
  17. Lin, C.C.; Liu, X.L.; Tai, W.L.; Yuan, S.M. A novel reversible data hiding scheme based on AMBTC compression technique. Multimed. Tools Appl. 2015, 74, 3823–3842. [Google Scholar] [CrossRef] [Scilit]
  18. Huang, Y.H.; Chang, C.C.; Chen, Y.H. Hybrid secret hiding schemes based on absolute moment block truncation coding. Multimed. Tools Appl. 2017, 76, 6159–6174. [Google Scholar] [CrossRef] [Scilit]
  19. Chang, C.C.; Chen, T.S.; Wang, Y.K.; Liu, Y. A reversible data hiding scheme based on absolute moment block truncation coding compression using exclusive OR operator. Multimed. Tools Appl. 2018, 77, 9039–9053. [Google Scholar] [CrossRef] [Scilit]
  20. Kumar, R.; Kim, D.S.; Jung, K.H. Enhanced AMBTC based data hiding method using hamming distance and pixel value differencing. J. Inf. Secur. Appl. 2019, 47, 94–103. [Google Scholar] [CrossRef] [Scilit]
  21. Horng, J.H.; Chang, C.C.; Li, G.L. Steganography using quotient value differencing and LSB substitution for AMBTC compressed images. IEEE Access 2020, 8, 129347–129358. [Google Scholar] [CrossRef] [Scilit]
  22. Sun, W.; Lu, Z.M.; Wen, Y.C.; Yu, F.X.; Shen, R.J. High performance reversible data hiding for block truncation coding compressed images. Signal Image Video Process. 2013, 7, 297–306. [Google Scholar] [CrossRef] [Scilit]
  23. Liu, J.C.; Lin, Y.; Chang, C.C.; Chang, C.C. A side match oriented data hiding based on absolute moment block truncation encoding mechanism with reversibility. Multimed. Tools Appl. 2024, 1–23. [Google Scholar] [CrossRef] [Scilit]
  24. Wu, D.C.; Tsai, W.H. A steganographic method for images by pixel-value differencing. Pattern Recognit. Lett. 2003, 24, 1613–1626. [Google Scholar] [CrossRef] [Scilit]
  25. Chang, I.C.; Hu, Y.C.; Chen, W.L.; Lo, C.C. High capacity reversible data hiding scheme based on residual histogram shifting for block truncation coding. Signal Process. 2015, 108, 376–388. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.