# An Efficient Encoding Algorithm Using Local Path on Huffman Encoding Algorithm for Compression
## 4 Simulation Experiments  
The performance of the proposed encoding algorithm was tested on three different sets of pictures. In the first group, eight randomly selected images, frequently used in the literature from USC-SIPI [38] miscellaneous databases, were chosen to prove the efficacy of the proposed coding algorithm. The sample images selected from the database included color and grayscale images in order to prove the performance of the encoding algorithm, and are shown Figure 11.  
These images were compared with the Huffman encoding and arithmetic coding algorithm results. Results are tabulated in Table 7. Equation (1) was used to calculate the CP and Equation 2 was used to calculate the NoBPP of each algorithm per image. Figure 11: Group 1 images. Figure 10: Bit Sequence of encoding algorithms. (**a**) Huffman encoding algorithm. (**b**) Proposed encoding algorithm. The second group of images used in this research included images of nature, maps, animals, and people, all chosen from the internet randomly and with different characteristics. The images used in the evaluation of the performance of the proposed coding algorithm are shown in Figure 12.  
The same algorithms were applied to this group as in the first group of images. The characteristics of the images and the results of the CP and NoBPP are listed in Table 8.  
The third group of images used in the evaluation of the developed encoding algorithm included medical images. Medical image compression is frequently studied in the literature because these images have large file sizes and increasing image sizes. Retinal images are preferred as medical images in compression. The test images were taken from the Structured Analysis of the Retina (STARE) [39] database, as shown in Figure 13. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline  & & & \multicolumn{2}{c}{**Huffman**} & \multicolumn{2}{c}{**Arithmetic**} & \multirow{2}{*}{**Proposed**} \\ \multirow{2}{*}{**Image**} & \multirow{2}{*}{**Type**} & \multirow{2}{*}{**Size**} & \multicolumn{2}{c}{**Encoding**} & \multicolumn{2}{c}{**Coding**} & \multicolumn{2}{c}{**Algorithm**} \\ \cline{5-8}  & & & \multicolumn{2}{c}{**Angoffman**} & \multicolumn{2}{c}{**Coding**} & \multicolumn{2}{c}{**Angoffman**} \\ \cline{5-8}  & & & \multicolumn{2}{c}{**NoBPP**} & **CP** & **NoBPP** & **CP** & **NoBPP** & **CP** \\ \hline Airplane & Gray & 256 \(\times\) 256 & 7.44 & 7.25 & 6.48 & 19.22 & 6.79 & 15.31 \\ Clock & Gray & 256 \(\times\) 256 & 7.73 & 3.52 & 6.73 & 16.09 & 7.29 & 9.09 \\ Candies & Color & 256 \(\times\) 256 & 6.82 & 14.78 & 5.82 & 27.35 & 6.04 & 24.58 \\ Lena & Gray & 512 \(\times\) 512 & 7.38 & 8.14 & 7.35 & 8.45 & 7.36 & 8.41 \\ Lena & Color & 512 \(\times\) 512 & 7.29 & 8.93 & 7.38 & 7.74 & 7.41 & 7.42 \\ House & Color & 512 \(\times\) 512 & 7.45 & 6.94 & 7.42 & 7.25 & 7.55 & 5.68 \\ Man & Gray & 1024 \(\times\) 1024 & 7.55 & 5.65 & 7.61 & 4.90 & 7.54 & 5.71 \\ Airfield & Gray & 1024 \(\times\) 1024 & 7.87 & 1.67 & 7.60 & 5.07 & 7.87 & 1.68 \\ \hline \hline \end{tabular}
\end{table} 
Table 7: Compression percentages of Group 1 images. Figure 12: Group 2 images.