# Data Hiding Method for Color AMBTC Compressed Images Using Color Difference
## 4 Proposed Method
### The Proposed Color AMBTC Using k-Means  
When a color image is compressed with traditional color AMBTC, three bit-planes are used per block, but the method suggested in this section uses a common bit-plane to improve compression performance. The common bit plane is obtained by the k-mean clustering. The detailed compression process is described in stages. Input: Original image, \(\mathcal{OI}\); The image size, \(N\times N\)  
Output: Color AMBTC compressed image, \(\mathcal{CI}\)  
Step 1: The original image sized \(n\times n\) is divided into non-overlapping blocks (\(\mathcal{P}\)) of size \(m\times m\) (let \(m=4\)) and each block is processed individually. Also let us say \(m^{2}=k\). Here, the variable \(i\) denotes \(\{1\leq i\leq n\times n/(m\times m)\}\) and \(j\) denotes \(\{1\leq j\leq m\times m\}\). Step 2: For each block \(\mathcal{P}_{i}\), transform a block of RGB layer into a common block containing the luminance using Equation (6), where \(p_{j}\) is a pixel. \[p^{\prime}_{j}=0.299\times p^{R}_{j}+0.587\times p^{G}_{j}+0.114\times p^{B}_ {j} \tag{6}\]  
Step 3: Apply the k-means clustering algorithm to the pixels of \(\mathcal{P}^{\prime}_{i}\). Here, the number of clusters is k (\(=3\)). After executing the k-means, a common bitmap \(M\) composed of {00,01,10} is obtained as in Figure 2.  
Step 4: The common bitmap \(M\) is divided into three sets: \(M_{0}\), \(M_{1}\) and \(M_{2}\), where \(M=M_{0}\cup M_{1}\cup M_{2}\) and \(M_{0}\cap M_{1}\cap M_{2}=\phi\).Here, \(M_{0}\), \(M_{1}\), and \(M_{2}\) are \(M_{0}=\{00_{0},00_{1},\ldots,00_{l_{0}}\}\), \(M_{1}=\{01_{0},01_{1},\ldots,01_{l_In the following equations, the variables such as R, G, and B refer to the R, G, and B layers of block \(\mathcal{P}_{i}\) and each layer consists of \(m\times m\) pixels. \[Q_{l_{1}}^{R}= \begin{cases}\lfloor\frac{1}{l_{0}}\sum_{j=1}^{l_{0}}R_{j}\rfloor,& \text{if}(M_{j}=\text{ }^{\prime}00^{\prime}),\\ \lfloor\frac{1}{l_{1}}\sum_{j=1}^{l_{1}}R_{j}\rfloor,&\text{if}(M_{j}=\text{ }^{\prime}01^{\prime}),\\ \lfloor\frac{1}{l_{2}}\sum_{j=1}^{l_{2}}R_{j}\rfloor,&\text{if}(M_{j}=\text{ }^{\prime}10^{\prime}).\end{cases}  \tag{7}\]  
\[Q_{l_{2}}^{G}= \begin{cases}\lfloor\frac{1}{l_{0}}\sum_{j=1}^{l_{0}}G_{j}\rfloor, &\text{if}(M_{j}=\text{ }^{\prime}00^{\prime}),\\ \lfloor\frac{1}{l_{1}}\sum_{j=1}^{l_{1}}G_{j}\rfloor,&\text{if}(M_{j}=\text{ }^{\prime}01^{\prime}),\\ \lfloor\frac{1}{l_{2}}\sum_{j=1}^{l_{2}}G_{j}\rfloor,&\text{if}(M_{j}=\text{ }^{\prime}10^{\prime}).\end{cases}  \tag{8}\]  
\[Q_{l_{3}}^{B}= \begin{cases}\lfloor\frac{1}{l_{0}}\sum_{j=1}^{l_{0}}B_{j}\rfloor, &\text{if}(M_{j}=\text{ }^{\prime}00^{\prime}),\\ \lfloor\frac{1}{l_{1}}\sum_{j=1}^{l_{1}}B_{j}\rfloor,&\text{if}(M_{j}=\text{ }^{\prime}01^{\prime}),\\ \lfloor\frac{1}{l_{2}}\sum_{j=1}^{l_{2}}B_{j}\rfloor,&\text{if}(M_{j}=\text{ }^{\prime}10^{\prime}).\end{cases}  \tag{9}\]  
Step 5: To compress the quantized values for each of R, G, and B once again, the LSB is compressed in a way that does not use the LSBs for \(Q_{1}\), \(Q_{2}\), and \(Q_{3}\). To do this, the LSBs are removed by Equation (10), where \(\lfloor\cdot\rfloor\) is a truncation function. \[Q_{i}=\sum_{j=1}^{9}\left\lfloor\frac{Q_{j}}{2}\right\rfloor\times 2 \tag{10}\]  
The expression range of the quantized pixel value \(Q\) is \((b_{7},b_{6},\dots,b_{1})=(128\ 64\ 32\ 16\ 8\ 4\ 2)\). Step 6: The compressed data is added to the \(\mathcal{CI}\), i.e., \(\mathcal{CI}\leftarrow\mathcal{CI}\ ||\ \{Q_{1}^{R},Q_{2}^{R},Q_{3}^{R},Q_{1}^{G},Q_{2}^{G},Q_{3}^{G},\)\(Q_{1}^{B},Q_{2}^{B},Q_{3}^{B},M,\dots\}\). Repeat _Steps_ 2 to 6 until all blocks are extruded. After performing the proposed AMBTC, it is compressed to 95 bits per block, and the compression efficiency is improved by one bit more than that (96 bits per block) compared with CAMBTC, introduced in Section 2. Moreover, three quantization levels were used to consider the quality of the image, and for compression, the expression range of each quantization level was proposed to be seven bits.