# Data Hiding Method for Color AMBTC Compressed Images Using Color Difference
## 3 Preliminaries  
### Color AMBTC  
AMBTC [11] is a lossy compression method for grayscale images and preserves moment quantization values based on blocks. After dividing the image by sized \(m\times m\) blocks, it is compressing by creating two quantization levels and a bitmap for each block.  
This is due to the similarity of pixels within the block. However, as much as the difference between the compressed pixels and the original pixels causes the distortion of the compressed image, but the difference is relatively small. If the block size is \(4\times 4\), the bit rate is 2 bits per pixel for the block because compression rate (CR) (=size of original image/size of compressed image) is 4. The merits of AMBTC are simple computation and fast image compression.  
The AMBTC encoding is performed as follows.  
1. The original image of size \(n\times n\) is divided into non-overlapping blocks (\(P\)) of size \(m\times m\) (let \(m=4\)) and each block is processed individually. Also let us say \(m^{2}=k\).
2. For each block \(P_{i}\), the mean of the pixels constituting \(P_{i}\) is calculated and assigned to \(\bar{x}\) (Equation (1)), where the variable \(i\) denotes \(\{1\leq i\leq n\times n/(m\times m)\}\) and \(j\) denotes \(\{1\leq j\leq m\times m\}\). \[\bar{x}=\frac{\sum_{j=1}^{k}x_{j}}{k}\] (1)Step 3: A bit-plane for the block \(P_{l}\) is caused by a simple calculation of Equation (2), i.e., if the pixel \(x_{j}\) is greater than equal to the mean \((\bar{x})\) then it is assigned a '1', otherwise it is assigned a '0'. As a result, a bitmap \(M\) consisting of 0s and 1s is obtained.  
\[b_{j}=\begin{cases}1,&\text{if }x_{j}\geq\bar{x},\\ 0,&\text{if }x_{j}<\bar{x}.\end{cases} \tag{2}\]  
Step 4: The bitmap \(M\) is divided into two sets, \(M_{0}\) and \(M_{1}\), where \(M=M_{0}\cup M_{1}\) and \(M_{0}\cap M_{1}=\phi\). \(M_{0}\) and \(M_{1}\) are \(M_{0}=\{0_{0},0_{1},\dots,0_{t}\}\), \(M_{1}=\{1_{0},1_{1},\dots,1_{(k-l)}\}\), respectively. Two values of \(t\) and \(k-t\) are each number of pixels of group '0' and '1'. The means of pixels \(Q_{1}\) and \(Q_{2}\) in the two groups represent the quantization levels of groups '0' and '1', respectively. The two quantization levels are calculated by Equations (3) and (4).  
\[Q_{1}=\left\lfloor\frac{1}{t}\sum_{x_{j}<\bar{x}}x_{j}\right\rfloor \tag{3}\]  
\[Q_{2}=\left\lfloor\frac{1}{k-t}\sum_{x_{j}\geq\bar{x}}x_{j}\right\rfloor \tag{4}\]  
Step 5: Two quantization levels \(Q_{1}\) and \(Q_{2}\) and a bitmap \(M\) are added to a _trio_, i.e., _trio_\(\leftarrow\)_trio_\(||\{Q_{1},Q_{2},M\}\).  
Step 6: Steps 2 to 5 are repeated until encoding is completed for all blocks.  
The two quantization levels \(Q_{1}\) and \(Q_{2}\) can be used in the process of reconstructing the compressed image, and the method by using Equation (5), where \(g_{j}\) denotes a pixel of grayscale.  
\[g_{j}=\begin{cases}Q_{1},&\text{if }b_{j}=0,\\ Q_{2},&\text{if }b_{j}=1.\end{cases} \tag{5}\]  
To compress a color image using traditional AMTC (CAMBTC), the RGB, which is the color image as shown in Figure 1, is decomposed into layers R, G, and B, and then the AMBTC method is applied to each layer. A block of CAMBTC format is \(trio\_RGB_{i}=\{Q_{1}^{R},Q_{2}^{R},M_{1}^{R},Q_{1}^{G},Q_{2}^{G},M_{2}^{G},Q_ {1}^{R},Q_{2}^{B},M_{3}^{B}\}\). The compression code of each RGB color image block consists of 3 planes and 6 quantization levels.  
Figure 1: RGB image consisting of three layers.